mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-02 20:19:55 +03:00
Seal all possible classes, add LICENSE, follow async naming conventions
This commit is contained in:
parent
ac63719a0b
commit
e767205c1a
20 changed files with 873 additions and 123 deletions
|
@ -5,7 +5,7 @@ using Discord.WebSocket;
|
|||
|
||||
namespace Boyfriend;
|
||||
|
||||
public class EventHandler {
|
||||
public sealed class EventHandler {
|
||||
private readonly DiscordSocketClient _client = Boyfriend.Client;
|
||||
|
||||
public void InitEvents() {
|
||||
|
@ -50,7 +50,7 @@ public class EventHandler {
|
|||
if (auditLogEntry.Data is MessageDeleteAuditLogData data && msg.Author.Id == data.Target.Id)
|
||||
mention = auditLogEntry.User.Mention;
|
||||
|
||||
await Utils.SendFeedback(
|
||||
await Utils.SendFeedbackAsync(
|
||||
string.Format(Messages.CachedMessageDeleted, msg.Author.Mention, Utils.MentionChannel(channel.Id),
|
||||
Utils.Wrap(msg.CleanContent)), guild.Id, mention);
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class EventHandler {
|
|||
(message.Content.Contains(prev) || message.Content.Contains(prevFailsafe))))
|
||||
return;
|
||||
|
||||
_ = new CommandProcessor(message).HandleCommand();
|
||||
_ = new CommandProcessor(message).HandleCommandAsync();
|
||||
}
|
||||
|
||||
private static async Task MessageUpdatedEvent(Cacheable<IMessage, ulong> messageCached, SocketMessage messageSocket,
|
||||
|
@ -98,7 +98,7 @@ public class EventHandler {
|
|||
|
||||
var isLimitedSpace = msg.CleanContent.Length + messageSocket.CleanContent.Length < 1940;
|
||||
|
||||
await Utils.SendFeedback(
|
||||
await Utils.SendFeedbackAsync(
|
||||
string.Format(Messages.CachedMessageEdited, Utils.MentionChannel(channel.Id),
|
||||
Utils.Wrap(msg.CleanContent, isLimitedSpace), Utils.Wrap(messageSocket.CleanContent, isLimitedSpace)),
|
||||
guildId, msg.Author.Mention);
|
||||
|
@ -176,4 +176,4 @@ public class EventHandler {
|
|||
await channel.SendMessageAsync(string.Format(Messages.EventCompleted, Utils.Wrap(scheduledEvent.Name),
|
||||
Utils.Wrap(scheduledEvent.StartTime.Subtract(DateTimeOffset.Now).Negate().ToString())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue