16 Commits
Author SHA1 Message Date
Stone-Red-Code d45fcbe248 Update .gitignore 2021-06-30 07:39:55 +02:00
Stone_Red d9bf6bca64 Delete empty.env 2021-04-28 22:10:32 +02:00
Stone_Red ba6433187a Add files via upload 2021-04-28 22:09:19 +02:00
Stone_Red 0e24bb7e3d Update README.md 2021-03-12 08:35:03 +01:00
Stone_Red 74d1d498b1 Update README.md 2021-02-14 00:43:58 +01:00
Stone_Red cd76796292 Update README.md 2021-02-13 19:36:50 +01:00
Stone-Red-Code 1f85c8eb87 Update .gitignore 2021-02-13 13:54:22 +01:00
Stone-Red-Code 6ed652728f Release Builds 2021-02-13 13:53:44 +01:00
Stone_Red 6a7d577932 Update README.md 2021-02-13 01:01:53 +01:00
Stone_Red f38fe3fadc Update README.md 2021-02-13 01:00:05 +01:00
Stone_Red 30d5871d2d Update README.md 2021-02-13 00:55:18 +01:00
Stone_Red 1e40e3de41 Update README.md 2021-02-13 00:42:10 +01:00
Stone-Red-Code fd9f3c91bc Merge branch 'main' of https://github.com/Stone-Red-Code/Discord_Simple-Embed-Bot into main 2021-02-13 00:30:42 +01:00
Stone-Red-Code 717b3233d6 Improved command structure 2021-02-13 00:30:33 +01:00
Stone-Red-Code aae747f49d Improved 'Token not found' error message 2021-02-12 19:27:54 +01:00
Stone-Red-Code 508a1f6a99 Made SQL path cross platform 2021-02-12 18:37:50 +01:00
658 changed files with 14631 additions and 233 deletions
+389 -1
View File
@@ -1 +1,389 @@
token.txt
*.env
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Nuget personal access tokens and Credentials
nuget.config
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
.idea/
*.sln.iml
Binary file not shown.
BIN
View File
Binary file not shown.
+19 -141
View File
@@ -12,22 +12,21 @@ namespace Discord_Simple_Embed_Bot
{
public static class CommandHandler
{
public static DiscordSocketClient Client;
private static readonly SqlManager sqlManager = new SqlManager();
public static DiscordSocketClient Client { get; set; }
static readonly Dictionary<string, Command> _commands = new()
public static readonly Dictionary<string, Command> CommandList = new()
{
{ "help", new Command { Fun = Help, Desc = "Lists all commands", Usage = "<command>" } },
{ "prefix", new Command { Fun = ChangePrefix, Desc = "Changes prefix", Usage = "<prefix>" } },
{ "help", new Command { Fun = Commands.Help, Desc = "Lists all commands", Usage = "<command>" } },
{ "prefix", new Command { Fun = Commands.ChangePrefix, Desc = "Changes prefix", Usage = "<prefix>" } },
{
"new",
new Command
{
Fun = CreateEmbed,
Fun = Commands.CreateEmbed,
Desc = "Creats new embed",
Usage = "<title>\n<hex color>\n<description>\n<field>",
Usage = "<title>\n<hex color>\n<description>\n<fields>",
Example = "Title"
+ "\n#FFFFFF"
+ "\n#EEEEEE"
+ "\nDescription"
+ "\n++Field name"
+ "\nField content"
@@ -42,15 +41,17 @@ namespace Discord_Simple_Embed_Bot
public static async Task HandleCommand(SocketMessage messageParam)
{
SocketUserMessage message = messageParam as SocketUserMessage;
if (message == null) return;
if (message is null) return;
int argPos = 0;
string prefix = PrefixFromMessage(message);
if (message.MentionedUsers.Any(x => x.Discriminator == Client.CurrentUser.Discriminator))
{
EmbedBuilder eb = new EmbedBuilder();
eb.Color = Color.Blue;
eb.Description = $"Use `{prefix} help` to list all commands.";
EmbedBuilder eb = new EmbedBuilder
{
Color = Color.Blue,
Description = $"Use `{prefix} help` to list all commands."
};
await message.Channel.SendMessageAsync("", false, eb.Build());
return;
}
@@ -65,12 +66,12 @@ namespace Discord_Simple_Embed_Bot
if (command.Contains(" "))
command = command.Substring(0, command.IndexOf(" "));
if (_commands.ContainsKey(command))
if (CommandList.ContainsKey(command))
{
SocketGuildUser socketGuildUser = message.Author as SocketGuildUser;
if (socketGuildUser.GuildPermissions.Administrator)
{
await _commands[command].Fun(message);
await CommandList[command].Fun(message);
}
}
else
@@ -79,17 +80,17 @@ namespace Discord_Simple_Embed_Bot
}
}
static string PrefixFromMessage(SocketUserMessage message)
public static string PrefixFromMessage(SocketUserMessage message)
{
string prefix = sqlManager.GetData((message.Channel as SocketGuildChannel).Guild.Id, 'p').Result;
string prefix = SqlManager.GetData((message.Channel as SocketGuildChannel).Guild.Id, 'p').Result;
GC.Collect();
GC.WaitForPendingFinalizers();
return prefix;
}
static string[] CheckCommandArgs(string content, int min, int max, string prefix)
public static string[] CheckCommandArgs(string content, int min, int max, string prefix)
{
content = content.Trim();
content = content.Remove(0, prefix.Length).Trim();
@@ -107,130 +108,7 @@ namespace Discord_Simple_Embed_Bot
return null;
}
static public async Task Help(SocketUserMessage message)
{
EmbedBuilder eb = new EmbedBuilder();
eb.Color = Color.Blue;
string[] args = CheckCommandArgs(message.Content, 0, 1, PrefixFromMessage(message));
if (args == null)
{
eb.Title = "Commands:";
foreach (var item in _commands)
{
eb.AddField(item.Key, item.Value.Desc);
}
}
else if (args.Length > 0)
{
if (_commands.ContainsKey(args[0].ToLower()))
{
eb.Title = args[0].ToLower();
eb.AddField("Parameters", _commands[args[0].ToLower()].Usage);
if (!string.IsNullOrWhiteSpace(_commands[args[0].ToLower()].Example))
{
eb.AddField("Example", $"```{PrefixFromMessage(message)} {args[0].ToLower()} {_commands[args[0].ToLower()].Example}```");
}
}
else
{
eb.WithDescription("Command not found!");
}
}
await message.Channel.SendMessageAsync("", false, eb.Build());
}
static public async Task ChangePrefix(SocketUserMessage message)
{
string prefix = "";
if (message.Content.Contains(" "))
prefix = message.Content[message.Content.LastIndexOf(" ")..].Trim();
if (prefix.Length <= 0)
{
await message.Channel.SendMessageAsync($"Prefix not valid!");
return;
}
await sqlManager.SetData((message.Channel as SocketGuildChannel).Guild.Id, prefix, 'p');
await message.Channel.SendMessageAsync($"Prefix changed to: `{prefix}`");
}
static public async Task CreateEmbed(SocketUserMessage message)
{
string prefix = PrefixFromMessage(message);
string content = message.Content[prefix.Length..].Trim()[3..];
string[] lines = content.Split("\n");
await message.DeleteAsync();
EmbedBuilder eb = new EmbedBuilder();
eb.Title = lines[0];
if (lines.Length > 1)
{
try
{
if (!lines[1].Contains("#"))
lines[1] = "#" + lines[1];
System.Drawing.Color col = (System.Drawing.Color)new System.Drawing.ColorConverter().ConvertFromString(lines[1]);
eb.Color = new Color(col.R, col.G, col.B);
}
catch { }
}
if (lines.Length > 2)
{
eb.Description = lines[2];
}
EmbedFieldBuilder efb = null;
foreach (string line in lines.Skip(3))
{
if (line.StartsWith("++"))
{
if (efb is not null)
eb.AddField(efb);
efb = new EmbedFieldBuilder();
efb.IsInline = false;
efb.Name = line.Remove(0, 2);
}
else if (line.StartsWith("--"))
{
if (efb is not null)
eb.AddField(efb);
efb = new EmbedFieldBuilder();
efb.IsInline = true;
efb.Name = line.Remove(0, 2);
}
else if (efb is not null && !string.IsNullOrWhiteSpace(line))
{
efb.Value += line + "\n";
}
}
if (eb is not null)
eb.AddField(efb);
for (int i = 0; i < eb.Fields.Count; i++)
{
if (string.IsNullOrWhiteSpace(eb.Fields[i].Value as string))
{
eb.Fields[i].Value = "-";
}
}
try
{
await message.Channel.SendMessageAsync("", false, eb.Build());
}
catch (Exception ex)
{
await Logging.Log(new LogMessage(LogSeverity.Debug, "CMD Handler", "", ex));
}
}
class Command
public class Command
{
public string Desc { get; set; }
public string Usage { get; set; }
+134
View File
@@ -0,0 +1,134 @@
using Discord;
using Discord.WebSocket;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Discord_Simple_Embed_Bot
{
static class Commands
{
static public async Task Help(SocketUserMessage message)
{
EmbedBuilder eb = new EmbedBuilder();
eb.Color = Color.Blue;
string[] args = CommandHandler.CheckCommandArgs(message.Content, 0, 1, CommandHandler.PrefixFromMessage(message));
if (args == null)
{
eb.Title = "Commands:";
foreach (var item in CommandHandler.CommandList)
{
eb.AddField(item.Key, item.Value.Desc);
}
}
else if (args.Length > 0)
{
if (CommandHandler.CommandList.ContainsKey(args[0].ToLower()))
{
eb.Title = args[0].ToLower();
eb.AddField("Parameters", CommandHandler.CommandList[args[0].ToLower()].Usage);
if (!string.IsNullOrWhiteSpace(CommandHandler.CommandList[args[0].ToLower()].Example))
{
eb.AddField("Example", $"```{CommandHandler.PrefixFromMessage(message)} {args[0].ToLower()} {CommandHandler.CommandList[args[0].ToLower()].Example}```");
}
}
else
{
eb.WithDescription("Command not found!");
}
}
await message.Channel.SendMessageAsync("", false, eb.Build());
}
static public async Task ChangePrefix(SocketUserMessage message)
{
string prefix = "";
if (message.Content.Contains(" "))
prefix = message.Content[message.Content.LastIndexOf(" ")..].Trim();
if (prefix.Length <= 0)
{
await message.Channel.SendMessageAsync($"Prefix not valid!");
return;
}
await SqlManager.SetData((message.Channel as SocketGuildChannel).Guild.Id, prefix, 'p');
await message.Channel.SendMessageAsync($"Prefix changed to: `{prefix}`");
}
static public async Task CreateEmbed(SocketUserMessage message)
{
string prefix = CommandHandler.PrefixFromMessage(message);
string content = message.Content[prefix.Length..].Trim()[3..];
string[] lines = content.Split("\n");
await message.DeleteAsync();
EmbedBuilder eb = new EmbedBuilder();
eb.Title = lines[0];
if (lines.Length > 1)
{
try
{
if (!lines[1].Contains("#"))
lines[1] = "#" + lines[1];
System.Drawing.Color col = (System.Drawing.Color)new System.Drawing.ColorConverter().ConvertFromString(lines[1]);
eb.Color = new Color(col.R, col.G, col.B);
}
catch { }
}
if (lines.Length > 2)
{
eb.Description = lines[2];
}
EmbedFieldBuilder efb = null;
foreach (string line in lines.Skip(3))
{
if (line.StartsWith("++"))
{
if (efb is not null)
eb.AddField(efb);
efb = new EmbedFieldBuilder();
efb.IsInline = false;
efb.Name = line.Remove(0, 2);
}
else if (line.StartsWith("--"))
{
if (efb is not null)
eb.AddField(efb);
efb = new EmbedFieldBuilder();
efb.IsInline = true;
efb.Name = line.Remove(0, 2);
}
else if (efb is not null && !string.IsNullOrWhiteSpace(line))
{
efb.Value += line + "\n";
}
}
if (eb is not null)
eb.AddField(efb);
for (int i = 0; i < eb.Fields.Count; i++)
{
if (string.IsNullOrWhiteSpace(eb.Fields[i].Value as string))
{
eb.Fields[i].Value = "-";
}
}
try
{
await message.Channel.SendMessageAsync("", false, eb.Build());
}
catch (Exception ex)
{
await Logging.Log(new LogMessage(LogSeverity.Debug, "CMD Handler", "", ex));
}
}
}
}
+14 -13
View File
@@ -9,25 +9,25 @@ namespace Discord_Simple_Embed_Bot
{
public class Program
{
public static void Main()
=> new Program().MainAsync().GetAwaiter().GetResult();
public static void Main() => new Program().MainAsync().GetAwaiter().GetResult();
public async Task MainAsync()
{
string tokenPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "token.txt");
string tokenPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "token.env");
if (!File.Exists(tokenPath))
File.Create(tokenPath).Close();
string token = File.ReadAllText(tokenPath);
if (string.IsNullOrWhiteSpace(token))
{
await Logging.Log(new LogMessage(LogSeverity.Critical, "Main", "Please put the Bot-Token into: " + tokenPath));
await Logging.Log(new LogMessage(LogSeverity.Critical, "Main", "", new ArgumentNullException("Token", $"Bot-Token not found! Put the Bot-Token into: '{tokenPath}'")));
return;
}
DiscordSocketClient _client = new DiscordSocketClient();
_client.Log += Logging.Log;
_client.MessageReceived += Client_MessageReceived;
try
{
await _client.LoginAsync(TokenType.Bot, token, false);
@@ -42,8 +42,6 @@ namespace Discord_Simple_Embed_Bot
//Block this task until the program is closed.
await Task.Delay(-1);
}
private async Task Client_MessageReceived(SocketMessage messageParam)
@@ -55,23 +53,26 @@ namespace Discord_Simple_Embed_Bot
static class Logging
{
public static Task Log(LogMessage msg)
{
lock (Console.Out)
{
Console.ForegroundColor = GetColor(msg.Severity);
Console.WriteLine(msg.ToString());
Console.ResetColor();
}
return Task.CompletedTask;
}
private static ConsoleColor GetColor(LogSeverity logSeverity)
{
switch (logSeverity)
return logSeverity switch
{
case LogSeverity.Critical: return ConsoleColor.DarkRed;
case LogSeverity.Error: return ConsoleColor.Red;
case LogSeverity.Warning: return ConsoleColor.DarkYellow;
case LogSeverity.Info: return ConsoleColor.Green;
default: return ConsoleColor.White;
}
LogSeverity.Critical => ConsoleColor.DarkRed,
LogSeverity.Error => ConsoleColor.Red,
LogSeverity.Warning => ConsoleColor.DarkYellow,
LogSeverity.Info => ConsoleColor.Green,
_ => ConsoleColor.White,
};
}
}
}
+13 -12
View File
@@ -7,12 +7,13 @@ using System.Threading.Tasks;
namespace Discord_Simple_Embed_Bot
{
class SqlManager {
readonly string sqlConnectionString;
readonly string databasePath;
public SqlManager()
static class SqlManager
{
databasePath = AppDomain.CurrentDomain.BaseDirectory + "\\MainDatabase.sqlite";
static readonly string sqlConnectionString;
static readonly string databasePath;
static SqlManager()
{
databasePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory + "MainDatabase.sqlite");
sqlConnectionString = "Data Source = " + databasePath + "; Version = 3";
//Create SQLite database file
@@ -36,19 +37,16 @@ namespace Discord_Simple_Embed_Bot
m_dbConnection.Close();
}
public async Task SetData(ulong serverId, string data, char type)
public static async Task SetData(ulong serverId, string data, char type)
{
await Task.Run(() =>
{
SQLiteConnection dbConnection = new SQLiteConnection(sqlConnectionString);
SQLiteCommand command = new SQLiteCommand();
command.CommandText = "INSERT OR REPLACE INTO Settings (ServerId,Data) values (@serverId, @prefix)";
SQLiteCommand command = new SQLiteCommand("INSERT OR REPLACE INTO Settings (ServerId,Data) values (@serverId, @prefix)", dbConnection);
command.Parameters.Add(new SQLiteParameter("@serverId", serverId + type));
command.Parameters.Add(new SQLiteParameter("@prefix", data));
dbConnection.Open();
command.Connection = dbConnection;
command.ExecuteNonQuery();
@@ -56,16 +54,19 @@ namespace Discord_Simple_Embed_Bot
});
}
public async Task<string> GetData(ulong serverId, char type)
public static async Task<string> GetData(ulong serverId, char type)
{
return await Task<string>.Run(() =>
{
string data = null;
using (SQLiteConnection dbConnection = new SQLiteConnection(sqlConnectionString))
{
dbConnection.Open();
SQLiteCommand command = new SQLiteCommand($"SELECT * FROM Settings WHERE ServerId=@type", dbConnection);
command.Parameters.Add(new SQLiteParameter("@type", serverId + type));
dbConnection.Open();
SQLiteDataReader dr = command.ExecuteReader();
if (dr.Read())
{
@@ -0,0 +1,457 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v5.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v5.0": {
"Discord_Simple-Embed-Bot/1.0.0": {
"dependencies": {
"Discord.Net": "2.3.0",
"System.Data.SQLite.Core": "1.0.113.7"
},
"runtime": {
"Discord_Simple-Embed-Bot.dll": {}
}
},
"Discord.Net/2.3.0": {
"dependencies": {
"Discord.Net.Commands": "2.3.0",
"Discord.Net.Core": "2.3.0",
"Discord.Net.Rest": "2.3.0",
"Discord.Net.WebSocket": "2.3.0",
"Discord.Net.Webhook": "2.3.0"
}
},
"Discord.Net.Commands/2.3.0": {
"dependencies": {
"Discord.Net.Core": "2.3.0"
},
"runtime": {
"lib/netstandard2.1/Discord.Net.Commands.dll": {
"assemblyVersion": "2.3.0.0",
"fileVersion": "2.3.0.0"
}
}
},
"Discord.Net.Core/2.3.0": {
"dependencies": {
"Newtonsoft.Json": "12.0.2",
"System.Collections.Immutable": "1.3.1",
"System.Interactive.Async": "4.0.0"
},
"runtime": {
"lib/netstandard2.1/Discord.Net.Core.dll": {
"assemblyVersion": "2.3.0.0",
"fileVersion": "2.3.0.0"
}
}
},
"Discord.Net.Rest/2.3.0": {
"dependencies": {
"Discord.Net.Core": "2.3.0"
},
"runtime": {
"lib/netstandard2.1/Discord.Net.Rest.dll": {
"assemblyVersion": "2.3.0.0",
"fileVersion": "2.3.0.0"
}
}
},
"Discord.Net.Webhook/2.3.0": {
"dependencies": {
"Discord.Net.Core": "2.3.0",
"Discord.Net.Rest": "2.3.0"
},
"runtime": {
"lib/netstandard2.1/Discord.Net.Webhook.dll": {
"assemblyVersion": "2.3.0.0",
"fileVersion": "2.3.0.0"
}
}
},
"Discord.Net.WebSocket/2.3.0": {
"dependencies": {
"Discord.Net.Core": "2.3.0",
"Discord.Net.Rest": "2.3.0"
},
"runtime": {
"lib/netstandard2.1/Discord.Net.WebSocket.dll": {
"assemblyVersion": "2.3.0.0",
"fileVersion": "2.3.0.0"
}
}
},
"Microsoft.NETCore.Platforms/1.1.0": {},
"Microsoft.NETCore.Targets/1.1.0": {},
"Newtonsoft.Json/12.0.2": {
"runtime": {
"lib/netstandard2.0/Newtonsoft.Json.dll": {
"assemblyVersion": "12.0.0.0",
"fileVersion": "12.0.2.23222"
}
}
},
"Stub.System.Data.SQLite.Core.NetStandard/1.0.113.2": {
"runtime": {
"lib/netstandard2.1/System.Data.SQLite.dll": {
"assemblyVersion": "1.0.113.0",
"fileVersion": "1.0.113.0"
}
},
"runtimeTargets": {
"runtimes/linux-x64/native/SQLite.Interop.dll": {
"rid": "linux-x64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/osx-x64/native/SQLite.Interop.dll": {
"rid": "osx-x64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/win-x64/native/SQLite.Interop.dll": {
"rid": "win-x64",
"assetType": "native",
"fileVersion": "1.0.113.0"
},
"runtimes/win-x86/native/SQLite.Interop.dll": {
"rid": "win-x86",
"assetType": "native",
"fileVersion": "1.0.113.0"
}
}
},
"System.Collections/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0",
"Microsoft.NETCore.Targets": "1.1.0",
"System.Runtime": "4.3.0"
}
},
"System.Collections.Immutable/1.3.1": {
"dependencies": {
"System.Collections": "4.3.0",
"System.Diagnostics.Debug": "4.3.0",
"System.Globalization": "4.3.0",
"System.Linq": "4.3.0",
"System.Resources.ResourceManager": "4.3.0",
"System.Runtime": "4.3.0",
"System.Runtime.Extensions": "4.3.0",
"System.Threading": "4.3.0"
}
},
"System.Data.SQLite.Core/1.0.113.7": {
"dependencies": {
"Stub.System.Data.SQLite.Core.NetStandard": "1.0.113.2"
}
},
"System.Diagnostics.Debug/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0",
"Microsoft.NETCore.Targets": "1.1.0",
"System.Runtime": "4.3.0"
}
},
"System.Globalization/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0",
"Microsoft.NETCore.Targets": "1.1.0",
"System.Runtime": "4.3.0"
}
},
"System.Interactive.Async/4.0.0": {
"dependencies": {
"System.Linq.Async": "4.0.0"
},
"runtime": {
"lib/netcoreapp3.0/System.Interactive.Async.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.2"
}
}
},
"System.IO/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0",
"Microsoft.NETCore.Targets": "1.1.0",
"System.Runtime": "4.3.0",
"System.Text.Encoding": "4.3.0",
"System.Threading.Tasks": "4.3.0"
}
},
"System.Linq/4.3.0": {
"dependencies": {
"System.Collections": "4.3.0",
"System.Diagnostics.Debug": "4.3.0",
"System.Resources.ResourceManager": "4.3.0",
"System.Runtime": "4.3.0",
"System.Runtime.Extensions": "4.3.0"
}
},
"System.Linq.Async/4.0.0": {
"runtime": {
"lib/netcoreapp3.0/System.Linq.Async.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.0.0.2"
}
}
},
"System.Reflection/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0",
"Microsoft.NETCore.Targets": "1.1.0",
"System.IO": "4.3.0",
"System.Reflection.Primitives": "4.3.0",
"System.Runtime": "4.3.0"
}
},
"System.Reflection.Primitives/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0",
"Microsoft.NETCore.Targets": "1.1.0",
"System.Runtime": "4.3.0"
}
},
"System.Resources.ResourceManager/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0",
"Microsoft.NETCore.Targets": "1.1.0",
"System.Globalization": "4.3.0",
"System.Reflection": "4.3.0",
"System.Runtime": "4.3.0"
}
},
"System.Runtime/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0",
"Microsoft.NETCore.Targets": "1.1.0"
}
},
"System.Runtime.Extensions/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0",
"Microsoft.NETCore.Targets": "1.1.0",
"System.Runtime": "4.3.0"
}
},
"System.Text.Encoding/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0",
"Microsoft.NETCore.Targets": "1.1.0",
"System.Runtime": "4.3.0"
}
},
"System.Threading/4.3.0": {
"dependencies": {
"System.Runtime": "4.3.0",
"System.Threading.Tasks": "4.3.0"
}
},
"System.Threading.Tasks/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0",
"Microsoft.NETCore.Targets": "1.1.0",
"System.Runtime": "4.3.0"
}
}
}
},
"libraries": {
"Discord_Simple-Embed-Bot/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Discord.Net/2.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-YILjBwqYdvich6v1rfO/OhdBrdhPQB/AKEohYISdOJ+LiwfMPCafAo3YN/VutmeAGpvmrdv1fP/D0T3rHo2JrQ==",
"path": "discord.net/2.3.0",
"hashPath": "discord.net.2.3.0.nupkg.sha512"
},
"Discord.Net.Commands/2.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-D7/kpseW53Hmni0/Vr22VElIoitFFUa0XDaIiU+HwijObBf6+rfgquWNYF9hePV+xVyY0+eQ8FOtRmBMG7Cy4A==",
"path": "discord.net.commands/2.3.0",
"hashPath": "discord.net.commands.2.3.0.nupkg.sha512"
},
"Discord.Net.Core/2.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-W5mmQ7fzlQMPmKW/sJx9CrBjdSnC/V2Ao/OukpEr4L42NgyYJUjjs5wRoxKoOLU/b6hj3Q8g0FJ5IYrmt6KSnQ==",
"path": "discord.net.core/2.3.0",
"hashPath": "discord.net.core.2.3.0.nupkg.sha512"
},
"Discord.Net.Rest/2.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-5m2nV4A9QIBtRsc7yIu9rQpc4Q7GpL6AaZ+xeAFdPx9dkUhikHIVZ0l1qqmn+pFSAUZ9e9fTsKzMfr7Loqz4aQ==",
"path": "discord.net.rest/2.3.0",
"hashPath": "discord.net.rest.2.3.0.nupkg.sha512"
},
"Discord.Net.Webhook/2.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-6DSRbYVLPDUbD7wBmMesaUbHkYud+WKxt8OeWTkifR6iR1DzSZX5i1GubmWaPsVjGYr1TA8usTepshla7Fiu9w==",
"path": "discord.net.webhook/2.3.0",
"hashPath": "discord.net.webhook.2.3.0.nupkg.sha512"
},
"Discord.Net.WebSocket/2.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-mktzQvXy9oKF3j7F8/f3v9xcUmYxXb8oMBGD4czZRn0P/BOM4cz0OdmCHr5wVyMb0W7q0VxmnfKYNsN0kGzFNA==",
"path": "discord.net.websocket/2.3.0",
"hashPath": "discord.net.websocket.2.3.0.nupkg.sha512"
},
"Microsoft.NETCore.Platforms/1.1.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
"path": "microsoft.netcore.platforms/1.1.0",
"hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512"
},
"Microsoft.NETCore.Targets/1.1.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==",
"path": "microsoft.netcore.targets/1.1.0",
"hashPath": "microsoft.netcore.targets.1.1.0.nupkg.sha512"
},
"Newtonsoft.Json/12.0.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-rTK0s2EKlfHsQsH6Yx2smvcTCeyoDNgCW7FEYyV01drPlh2T243PR2DiDXqtC5N4GDm4Ma/lkxfW5a/4793vbA==",
"path": "newtonsoft.json/12.0.2",
"hashPath": "newtonsoft.json.12.0.2.nupkg.sha512"
},
"Stub.System.Data.SQLite.Core.NetStandard/1.0.113.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-yGIM9xFyPHl79HluNTSQarvAOIJ68pmzmlMayVN6Nivu/7TiaHt7WqptolvwmuKdAXei8OzENh9RNdh7d6evjQ==",
"path": "stub.system.data.sqlite.core.netstandard/1.0.113.2",
"hashPath": "stub.system.data.sqlite.core.netstandard.1.0.113.2.nupkg.sha512"
},
"System.Collections/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==",
"path": "system.collections/4.3.0",
"hashPath": "system.collections.4.3.0.nupkg.sha512"
},
"System.Collections.Immutable/1.3.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-n+AGX7zmiZumW9aggOkXaHzUeAS3EfeTErnkKCusyONUozbTv+kMb8VE36m+ldV6kF9g57G2c641KCdgH9E0pg==",
"path": "system.collections.immutable/1.3.1",
"hashPath": "system.collections.immutable.1.3.1.nupkg.sha512"
},
"System.Data.SQLite.Core/1.0.113.7": {
"type": "package",
"serviceable": true,
"sha512": "sha512-2DKMIxfZpIVzdMfx1dj9qvTm+0m0Mx6sN6CZXMQDNytU7Sk/JKo0Ox6mvHAicfHrQgqZbUZMzMMtLXD0kwmFfg==",
"path": "system.data.sqlite.core/1.0.113.7",
"hashPath": "system.data.sqlite.core.1.0.113.7.nupkg.sha512"
},
"System.Diagnostics.Debug/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==",
"path": "system.diagnostics.debug/4.3.0",
"hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512"
},
"System.Globalization/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==",
"path": "system.globalization/4.3.0",
"hashPath": "system.globalization.4.3.0.nupkg.sha512"
},
"System.Interactive.Async/4.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-tYEzSDQ3rn0G7sGgjcNB91C3dDRJc8m8Lavvu88dwt8FEwKPGZdp/tFs+lQTdqHDV9UItkGIwI8Aa6gGTvzLoQ==",
"path": "system.interactive.async/4.0.0",
"hashPath": "system.interactive.async.4.0.0.nupkg.sha512"
},
"System.IO/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==",
"path": "system.io/4.3.0",
"hashPath": "system.io.4.3.0.nupkg.sha512"
},
"System.Linq/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==",
"path": "system.linq/4.3.0",
"hashPath": "system.linq.4.3.0.nupkg.sha512"
},
"System.Linq.Async/4.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-WbiYEedFZeM+psmMyoCt1AKbZppAZg8Eq1ZTQ+521fGNeXqlgJj0tZYV5n1LsKRO5osQuitYxGNuzPTy3213sg==",
"path": "system.linq.async/4.0.0",
"hashPath": "system.linq.async.4.0.0.nupkg.sha512"
},
"System.Reflection/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==",
"path": "system.reflection/4.3.0",
"hashPath": "system.reflection.4.3.0.nupkg.sha512"
},
"System.Reflection.Primitives/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==",
"path": "system.reflection.primitives/4.3.0",
"hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512"
},
"System.Resources.ResourceManager/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==",
"path": "system.resources.resourcemanager/4.3.0",
"hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512"
},
"System.Runtime/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==",
"path": "system.runtime/4.3.0",
"hashPath": "system.runtime.4.3.0.nupkg.sha512"
},
"System.Runtime.Extensions/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==",
"path": "system.runtime.extensions/4.3.0",
"hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512"
},
"System.Text.Encoding/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==",
"path": "system.text.encoding/4.3.0",
"hashPath": "system.text.encoding.4.3.0.nupkg.sha512"
},
"System.Threading/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==",
"path": "system.threading/4.3.0",
"hashPath": "system.threading.4.3.0.nupkg.sha512"
},
"System.Threading.Tasks/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==",
"path": "system.threading.tasks/4.3.0",
"hashPath": "system.threading.tasks.4.3.0.nupkg.sha512"
}
}
}
@@ -0,0 +1,10 @@
{
"runtimeOptions": {
"additionalProbingPaths": [
"C:\\Users\\David\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\David\\.nuget\\packages",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Microsoft\\Xamarin\\NuGet"
]
}
}
@@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "net5.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "5.0.0"
}
}
}
@@ -0,0 +1,10 @@
{
"runtimeOptions": {
"additionalProbingPaths": [
"C:\\Users\\David\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\David\\.nuget\\packages",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Microsoft\\Xamarin\\NuGet"
]
}
}
@@ -0,0 +1,11 @@
{
"runtimeOptions": {
"tfm": "net5.0",
"includedFrameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "5.0.0"
}
]
}
}

Some files were not shown because too many files have changed in this diff Show More