Update time!

This commit is contained in:
EmotionChild 2022-04-18 22:52:03 +12:00
parent 58a9c0f842
commit 6a39ece053
No known key found for this signature in database
GPG key ID: 23DC06AC32786520
35 changed files with 2902 additions and 2892 deletions

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus; using DSharpPlus;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;

View file

@ -1,4 +1,4 @@
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities; using DSharpPlus.Entities;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;

View file

@ -1,4 +1,4 @@
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;
@ -10,11 +10,11 @@ namespace SupportChild.Commands
{ {
public class BlacklistCommand : BaseCommandModule public class BlacklistCommand : BaseCommandModule
{ {
[Command("balcklist")] [Command("blacklist")]
[Description("Blacklists a user from opening tickets.")] [Description("Blacklists a user from opening tickets.")]
public async Task OnExecute(CommandContext command, [RemainingText] string commandArgs) public async Task OnExecute(CommandContext command, [RemainingText] string commandArgs)
{ {
// Check is the user has permission to use this command. // Check if the user has permission to use this command.
if (!Config.HasPermission(command.Member, "blacklist")) if (!Config.HasPermission(command.Member, "blacklist"))
{ {
DiscordEmbed error = new DiscordEmbedBuilder DiscordEmbed error = new DiscordEmbedBuilder
@ -79,6 +79,7 @@ namespace SupportChild.Commands
Color = DiscordColor.Green, Color = DiscordColor.Green,
Description = blacklistedUser.Mention + " was blacklisted from opening tickets by " + command.Member.Mention + "." Description = blacklistedUser.Mention + " was blacklisted from opening tickets by " + command.Member.Mention + "."
}; };
await logChannel.SendMessageAsync(logMessage);
} }
} }
catch (Exception) catch (Exception)

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;

View file

@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;

View file

@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;

View file

@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;
@ -35,7 +35,7 @@ namespace SupportChild.Commands
DiscordEmbed error = new DiscordEmbedBuilder DiscordEmbed error = new DiscordEmbedBuilder
{ {
Color = DiscordColor.Red, Color = DiscordColor.Red,
Description = "Invalid list amount. (Must be an integer between 5 and 100)" Description = "Invalid list amount. (Must be integer between 5 and 100)"
}; };
await command.RespondAsync(error); await command.RespondAsync(error);
return; return;

View file

@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -13,7 +13,7 @@ namespace SupportChild.Commands
public class MoveCommand : BaseCommandModule public class MoveCommand : BaseCommandModule
{ {
[Command("move")] [Command("move")]
[Description("Move a ticket to another category.")] [Description("Moves a ticket to another category.")]
public async Task OnExecute(CommandContext command, [RemainingText] string commandArgs) public async Task OnExecute(CommandContext command, [RemainingText] string commandArgs)
{ {
// Check if the user has permission to use this command. // Check if the user has permission to use this command.

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus; using DSharpPlus;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;

View file

@ -1,4 +1,4 @@
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities; using DSharpPlus.Entities;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;

View file

@ -1,4 +1,4 @@
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities; using DSharpPlus.Entities;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -11,7 +11,7 @@ namespace SupportChild.Commands
public class SayCommand : BaseCommandModule public class SayCommand : BaseCommandModule
{ {
[Command("say")] [Command("say")]
[Cooldown(1, 2, CooldownBucketType.User)] [Cooldown(1, 2, CooldownBucketType.Channel)]
[Description("Prints a message with information from staff.")] [Description("Prints a message with information from staff.")]
public async Task OnExecute(CommandContext command, string identifier) public async Task OnExecute(CommandContext command, string identifier)
{ {

View file

@ -1,4 +1,4 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities; using DSharpPlus.Entities;
@ -39,13 +39,13 @@ namespace SupportChild.Commands
return; return;
} }
string sumarry = command.Message.Content.Replace(Config.prefix + "setsummary", "").Trim(); string summary = command.Message.Content.Replace(Config.prefix + "setsummary", "").Trim();
using (MySqlConnection c = Database.GetConnection()) using (MySqlConnection c = Database.GetConnection())
{ {
c.Open(); c.Open();
MySqlCommand update = new MySqlCommand(@"UPDATE tickets SET summary = @summary WHERE channel_id = @channel_id", c); MySqlCommand update = new MySqlCommand(@"UPDATE tickets SET summary = @summary WHERE channel_id = @channel_id", c);
update.Parameters.AddWithValue("@summary", sumarry); update.Parameters.AddWithValue("@summary", summary);
update.Parameters.AddWithValue("@channel_id", channelID); update.Parameters.AddWithValue("@channel_id", channelID);
update.Prepare(); update.Prepare();
update.ExecuteNonQuery(); update.ExecuteNonQuery();

View file

@ -1,4 +1,4 @@
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;

View file

@ -1,4 +1,4 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities; using DSharpPlus.Entities;
@ -29,7 +29,7 @@ namespace SupportChild.Commands
long closedTickets = Database.GetNumberOfClosedTickets(); long closedTickets = Database.GetNumberOfClosedTickets();
DiscordEmbed botInfo = new DiscordEmbedBuilder() DiscordEmbed botInfo = new DiscordEmbedBuilder()
.WithAuthor("EmotionChild/SupportChild @ GitHub", "https://github.com/EmotionChild/SupportChild", "https://cdn.discordapp.com/attachments/765441543100170271/919729931922051072/Ellise_Concept_2.png") .WithAuthor("EmotionChild/SupportChild @ GitHub", "https://github.com/EmotionChild/SupportChild", "https://cdn.emotionchild.com/Ellie.png")
.WithTitle("Bot information") .WithTitle("Bot information")
.WithColor(DiscordColor.Cyan) .WithColor(DiscordColor.Cyan)
.AddField("Version:", SupportChild.GetVersion(), false) .AddField("Version:", SupportChild.GetVersion(), false)

View file

@ -1,4 +1,4 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities; using DSharpPlus.Entities;

View file

@ -1,4 +1,4 @@
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;
@ -68,7 +68,7 @@ namespace SupportChild.Commands
DiscordEmbed message = new DiscordEmbedBuilder DiscordEmbed message = new DiscordEmbedBuilder
{ {
Color = DiscordColor.Red, Color = DiscordColor.Green,
Description = staffMember.active ? "Staff member is now set as inactive and will no longer be randomly assigned any support tickets." : "Staff member is now set as active and will be randomly assigned support tickets again." Description = staffMember.active ? "Staff member is now set as inactive and will no longer be randomly assigned any support tickets." : "Staff member is now set as active and will be randomly assigned support tickets again."
}; };
await command.RespondAsync(message); await command.RespondAsync(message);

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -25,7 +25,7 @@ namespace SupportChild.Commands
Description = "You do not have permission to use this command." Description = "You do not have permission to use this command."
}; };
await command.RespondAsync(error); await command.RespondAsync(error);
command.Client.Logger.Log(LogLevel.Information, "User tried to use the transcript but did not have permission."); command.Client.Logger.Log(LogLevel.Information, "User tried to use the transcript command but did not have permission.");
return; return;
} }
@ -98,7 +98,7 @@ namespace SupportChild.Commands
} }
// If there is no open or closed ticket, send an error. If there is a closed ticket we will simply use the old transcript from when the ticket was closed. // If there is no open or closed ticket, send an error. If there is a closed ticket we will simply use the old transcript from when the ticket was closed.
else if (!Database.TryGetClosedTicket(ticketID, out ticket) || (ticket?.creatorID != command.Member.Id && !Database.IsStaff(command.Member.Id))) else if (!Database.TryGetClosedTicket(ticketID, out ticket) || ticket?.creatorID != command.Member.Id && !Database.IsStaff(command.Member.Id))
{ {
DiscordEmbed error = new DiscordEmbedBuilder DiscordEmbed error = new DiscordEmbedBuilder
{ {

View file

@ -1,4 +1,4 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities; using DSharpPlus.Entities;

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;
@ -11,7 +11,7 @@ namespace SupportChild.Commands
public class UnblacklistCommand : BaseCommandModule public class UnblacklistCommand : BaseCommandModule
{ {
[Command("unblacklist")] [Command("unblacklist")]
[Description("Un-blacklists a user from from opening tickets.")] [Description("Un-blacklists a user from opening tickets.")]
public async Task OnExecute(CommandContext command, [RemainingText] string commandArgs) public async Task OnExecute(CommandContext command, [RemainingText] string commandArgs)
{ {
// Check if the user has permission to use this command. // Check if the user has permission to use this command.
@ -84,7 +84,7 @@ namespace SupportChild.Commands
} }
catch (Exception) catch (Exception)
{ {
DiscordEmbed message = new DiscordEmbedBuilder() DiscordEmbed message = new DiscordEmbedBuilder
{ {
Color = DiscordColor.Red, Color = DiscordColor.Red,
Description = "Error occured while removing " + blacklistedUser.Mention + " from blacklist." Description = "Error occured while removing " + blacklistedUser.Mention + " from blacklist."

View file

@ -1,4 +1,4 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using DSharpPlus.CommandsNext; using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes; using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities; using DSharpPlus.Entities;

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
@ -647,17 +647,17 @@ namespace SupportChild
public Ticket(MySqlDataReader reader) public Ticket(MySqlDataReader reader)
{ {
this.id = reader.GetUInt32("id"); id = reader.GetUInt32("id");
this.createdTime = reader.GetDateTime("created_time"); createdTime = reader.GetDateTime("created_time");
this.creatorID = reader.GetUInt64("creator_id"); creatorID = reader.GetUInt64("creator_id");
this.assignedStaffID = reader.GetUInt64("assigned_staff_id"); assignedStaffID = reader.GetUInt64("assigned_staff_id");
this.summary = reader.GetString("summary"); summary = reader.GetString("summary");
this.channelID = reader.GetUInt64("channel_id"); channelID = reader.GetUInt64("channel_id");
} }
public string FormattedCreatedTime() public string FormattedCreatedTime()
{ {
return this.createdTime.ToString(Config.timestampFormat); return createdTime.ToString(Config.timestampFormat);
} }
} }
public class StaffMember public class StaffMember
@ -668,9 +668,9 @@ namespace SupportChild
public StaffMember(MySqlDataReader reader) public StaffMember(MySqlDataReader reader)
{ {
this.userID = reader.GetUInt64("user_id"); userID = reader.GetUInt64("user_id");
this.name = reader.GetString("name"); name = reader.GetString("name");
this.active = reader.GetBoolean("active"); active = reader.GetBoolean("active");
} }
} }
@ -682,9 +682,9 @@ namespace SupportChild
public Message(MySqlDataReader reader) public Message(MySqlDataReader reader)
{ {
this.identifier = reader.GetString("identifier"); identifier = reader.GetString("identifier");
this.userID = reader.GetUInt64("user_id"); userID = reader.GetUInt64("user_id");
this.message = reader.GetString("message"); message = reader.GetString("message");
} }
} }
} }

View file

@ -21,7 +21,7 @@ namespace SupportChild
public EventHandler(DiscordClient client) public EventHandler(DiscordClient client)
{ {
this.discordClient = client; discordClient = client;
} }
internal Task OnReady(DiscordClient client, ReadyEventArgs e) internal Task OnReady(DiscordClient client, ReadyEventArgs e)
@ -35,7 +35,7 @@ namespace SupportChild
activityType = ActivityType.Playing; activityType = ActivityType.Playing;
} }
this.discordClient.UpdateStatusAsync(new DiscordActivity(Config.presenceText, activityType), UserStatus.Online); discordClient.UpdateStatusAsync(new DiscordActivity(Config.presenceText, activityType), UserStatus.Online);
return Task.CompletedTask; return Task.CompletedTask;
} }
@ -105,7 +105,7 @@ namespace SupportChild
DiscordEmbed error = new DiscordEmbedBuilder DiscordEmbed error = new DiscordEmbedBuilder
{ {
Color = DiscordColor.Red, Color = DiscordColor.Red,
Description = this.ParseFailedCheck(attr) Description = ParseFailedCheck(attr)
}; };
e.Context?.Channel?.SendMessageAsync(error); e.Context?.Channel?.SendMessageAsync(error);
} }

View file

@ -53,6 +53,7 @@
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter

View file

@ -29,7 +29,7 @@ namespace SupportChild
Console.WriteLine("Starting SupportChild version " + GetVersion() + "..."); Console.WriteLine("Starting SupportChild version " + GetVersion() + "...");
try try
{ {
this.Reload(); Reload();
// Block this task until the program is closed. // Block this task until the program is closed.
await Task.Delay(-1); await Task.Delay(-1);
@ -55,10 +55,10 @@ namespace SupportChild
public async void Reload() public async void Reload()
{ {
if (this.discordClient != null) if (discordClient != null)
{ {
await this.discordClient.DisconnectAsync(); await discordClient.DisconnectAsync();
this.discordClient.Dispose(); discordClient.Dispose();
Console.WriteLine("Discord client disconnected."); Console.WriteLine("Discord client disconnected.");
} }
@ -104,20 +104,20 @@ namespace SupportChild
Intents = DiscordIntents.All Intents = DiscordIntents.All
}; };
this.discordClient = new DiscordClient(cfg); discordClient = new DiscordClient(cfg);
this.eventHandler = new EventHandler(this.discordClient); eventHandler = new EventHandler(discordClient);
Console.WriteLine("Hooking events..."); Console.WriteLine("Hooking events...");
this.discordClient.Ready += this.eventHandler.OnReady; discordClient.Ready += eventHandler.OnReady;
this.discordClient.GuildAvailable += this.eventHandler.OnGuildAvailable; discordClient.GuildAvailable += eventHandler.OnGuildAvailable;
this.discordClient.ClientErrored += this.eventHandler.OnClientError; discordClient.ClientErrored += eventHandler.OnClientError;
this.discordClient.MessageCreated += this.eventHandler.OnMessageCreated; discordClient.MessageCreated += eventHandler.OnMessageCreated;
this.discordClient.GuildMemberAdded += this.eventHandler.OnMemberAdded; discordClient.GuildMemberAdded += eventHandler.OnMemberAdded;
this.discordClient.GuildMemberRemoved += this.eventHandler.OnMemberRemoved; discordClient.GuildMemberRemoved += eventHandler.OnMemberRemoved;
if (Config.reactionMessage != 0) if (Config.reactionMessage != 0)
{ {
this.discordClient.MessageReactionAdded += this.eventHandler.OnReactionAdded; discordClient.MessageReactionAdded += eventHandler.OnReactionAdded;
} }
Console.WriteLine("Registering commands..."); Console.WriteLine("Registering commands...");
@ -126,38 +126,38 @@ namespace SupportChild
StringPrefixes = new[] { Config.prefix } StringPrefixes = new[] { Config.prefix }
}); });
this.commands.RegisterCommands<AddCommand>(); commands.RegisterCommands<AddCommand>();
this.commands.RegisterCommands<AddMessageCommand>(); commands.RegisterCommands<AddMessageCommand>();
this.commands.RegisterCommands<AddStaffCommand>(); commands.RegisterCommands<AddStaffCommand>();
this.commands.RegisterCommands<AssignCommand>(); commands.RegisterCommands<AssignCommand>();
this.commands.RegisterCommands<BlacklistCommand>(); commands.RegisterCommands<BlacklistCommand>();
this.commands.RegisterCommands<CloseCommand>(); commands.RegisterCommands<CloseCommand>();
this.commands.RegisterCommands<ListAssignedCommand>(); commands.RegisterCommands<ListAssignedCommand>();
this.commands.RegisterCommands<ListCommand>(); commands.RegisterCommands<ListCommand>();
this.commands.RegisterCommands<ListOldestCommand>(); commands.RegisterCommands<ListOldestCommand>();
this.commands.RegisterCommands<ListUnassignedCommand>(); commands.RegisterCommands<ListUnassignedCommand>();
this.commands.RegisterCommands<MoveCommand>(); commands.RegisterCommands<MoveCommand>();
this.commands.RegisterCommands<NewCommand>(); commands.RegisterCommands<NewCommand>();
this.commands.RegisterCommands<RandomAssignCommand>(); commands.RegisterCommands<RandomAssignCommand>();
this.commands.RegisterCommands<ReloadCommand>(); commands.RegisterCommands<ReloadCommand>();
this.commands.RegisterCommands<RemoveMessageCommand>(); commands.RegisterCommands<RemoveMessageCommand>();
this.commands.RegisterCommands<RemoveStaffCommand>(); commands.RegisterCommands<RemoveStaffCommand>();
this.commands.RegisterCommands<SayCommand>(); commands.RegisterCommands<SayCommand>();
this.commands.RegisterCommands<SetSummaryCommand>(); commands.RegisterCommands<SetSummaryCommand>();
this.commands.RegisterCommands<SetTicketCommand>(); commands.RegisterCommands<SetTicketCommand>();
this.commands.RegisterCommands<StatusCommand>(); commands.RegisterCommands<StatusCommand>();
this.commands.RegisterCommands<SummaryCommand>(); commands.RegisterCommands<SummaryCommand>();
this.commands.RegisterCommands<ToggleActiveCommand>(); commands.RegisterCommands<ToggleActiveCommand>();
this.commands.RegisterCommands<TranscriptCommand>(); commands.RegisterCommands<TranscriptCommand>();
this.commands.RegisterCommands<UnassignCommand>(); commands.RegisterCommands<UnassignCommand>();
this.commands.RegisterCommands<UnblacklistCommand>(); commands.RegisterCommands<UnblacklistCommand>();
this.commands.RegisterCommands<UnsetTicketCommand>(); commands.RegisterCommands<UnsetTicketCommand>();
Console.WriteLine("Hooking command events..."); Console.WriteLine("Hooking command events...");
this.commands.CommandErrored += this.eventHandler.OnCommandError; commands.CommandErrored += eventHandler.OnCommandError;
Console.WriteLine("Connecting to Discord..."); Console.WriteLine("Connecting to Discord...");
await this.discordClient.ConnectAsync(); await discordClient.ConnectAsync();
} }
} }
} }

View file

@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<ApplicationIcon>ellie_icon.ico</ApplicationIcon> <ApplicationIcon>ellie_icon.ico</ApplicationIcon>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers> <RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
<Version>1.1.0</Version> <Version>1.2.0</Version>
<StartupObject>SupportChild.SupportChild</StartupObject> <StartupObject>SupportChild.SupportChild</StartupObject>
<Authors>EmotionChild</Authors> <Authors>EmotionChild</Authors>
<Product /> <Product />
@ -13,17 +13,18 @@
<RepositoryUrl>https://github.com/EmotionChild/SupportChild</RepositoryUrl> <RepositoryUrl>https://github.com/EmotionChild/SupportChild</RepositoryUrl>
<RepositoryType>Git</RepositoryType> <RepositoryType>Git</RepositoryType>
<PackageLicenseFile>LICENSE</PackageLicenseFile> <PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageIconUrl></PackageIconUrl> <PackageIconUrl>https://cdn.emotionchild.com/Ellie.png</PackageIconUrl>
<Description>A Discord support bot build for the Ellie's Home Discord server</Description> <Description>A Discord support bot build for the Ellie's Home Discord server</Description>
<AssemblyVersion>2.5.0.0</AssemblyVersion> <AssemblyVersion>2.6.1.1</AssemblyVersion>
<FileVersion>2.5.0.0</FileVersion> <FileVersion>2.6.1.1</FileVersion>
<NeutralLanguage>en</NeutralLanguage> <NeutralLanguage>en</NeutralLanguage>
<PackageVersion>1.2.0</PackageVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DSharpPlus" Version="4.1.0" /> <PackageReference Include="DSharpPlus" Version="4.2.0-nightly-01109" />
<PackageReference Include="DSharpPlus.CommandsNext" Version="4.1.0" /> <PackageReference Include="DSharpPlus.CommandsNext" Version="4.2.0-nightly-01109" />
<PackageReference Include="DSharpPlus.Interactivity" Version="4.1.0" /> <PackageReference Include="DSharpPlus.Interactivity" Version="4.2.0-nightly-01109" />
<PackageReference Include="JsonExtensions" Version="1.2.0" /> <PackageReference Include="JsonExtensions" Version="1.2.0" />
<PackageReference Include="MiniRazor.CodeGen" Version="2.2.1" /> <PackageReference Include="MiniRazor.CodeGen" Version="2.2.1" />
<PackageReference Include="MySql.Data" Version="8.0.28" /> <PackageReference Include="MySql.Data" Version="8.0.28" />
@ -49,6 +50,13 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="lib\" /> <Folder Include="lib\" />
</ItemGroup> </ItemGroup>

View file

@ -1,4 +1,4 @@
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using DiscordChatExporter.Core.Discord; using DiscordChatExporter.Core.Discord;

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Security.Cryptography; using System.Security.Cryptography;
using DSharpPlus.Entities; using DSharpPlus.Entities;
@ -15,8 +15,8 @@ namespace SupportChild
{ {
byte[] box = new byte[1]; byte[] box = new byte[1];
do provider.GetBytes(box); do provider.GetBytes(box);
while (!(box[0] < n * (Byte.MaxValue / n))); while (!(box[0] < n * (byte.MaxValue / n)));
int k = (box[0] % n); int k = box[0] % n;
n--; n--;
T value = list[k]; T value = list[k];
list[k] = list[n]; list[k] = list[n];

View file

@ -2,7 +2,7 @@ bot:
# Bot token. # Bot token.
token: "<add-token-here>" token: "<add-token-here>"
# Command prefix. # Command prefix.
prefix: "+" prefix: "-"
# Channel where ticket logs are posted (recommended) # Channel where ticket logs are posted (recommended)
log-channel: 000000000000000000 log-channel: 000000000000000000
# Category where the ticket will be created, it will have the same permissions of that ticket plus read permissions for the user opening the ticket (recommended) # Category where the ticket will be created, it will have the same permissions of that ticket plus read permissions for the user opening the ticket (recommended)
@ -25,7 +25,7 @@ bot:
# Possible values are: Playing, Streaming, ListeningTo, Watching, Competing # Possible values are: Playing, Streaming, ListeningTo, Watching, Competing
presence-type: "ListeningTo" presence-type: "ListeningTo"
# Sets the activity text shown in the bot's status # Sets the activity text shown in the bot's status
presence-text: "+new" presence-text: "-new"
notifications: notifications:
# Notifies the assigned staff member when a new message is posted in a ticket if the ticket has been silent for a configurable amount of time # Notifies the assigned staff member when a new message is posted in a ticket if the ticket has been silent for a configurable amount of time