mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-02 20:19:55 +03:00
fixed a few bugs in settings + code style consistency with string comparison
This commit is contained in:
parent
a06376443f
commit
2493e317d0
8 changed files with 72 additions and 51 deletions
|
@ -29,7 +29,7 @@ public class EventHandler {
|
|||
var channel = guild.GetTextChannel(Convert.ToUInt64(config["BotLogChannel"]));
|
||||
Utils.SetCurrentLanguage(guild.Id);
|
||||
|
||||
if (config["ReceiveStartupMessages"] != "true" || channel == null) continue;
|
||||
if (config["ReceiveStartupMessages"] is not "true" || channel == null) continue;
|
||||
await channel.SendMessageAsync(string.Format(Messages.Ready, Utils.GetBeep(i)));
|
||||
}
|
||||
}
|
||||
|
@ -112,11 +112,11 @@ public class EventHandler {
|
|||
var guild = user.Guild;
|
||||
var config = Boyfriend.GetGuildConfig(guild.Id);
|
||||
|
||||
if (config["SendWelcomeMessages"] == "true")
|
||||
if (config["SendWelcomeMessages"] is "true")
|
||||
await Utils.SilentSendAsync(guild.SystemChannel,
|
||||
string.Format(config["WelcomeMessage"], user.Mention, guild.Name));
|
||||
|
||||
if (config["StarterRole"] != "0")
|
||||
if (config["StarterRole"] is not "0")
|
||||
await user.AddRoleAsync(ulong.Parse(config["StarterRole"]));
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ public class EventHandler {
|
|||
var channel = guild.GetTextChannel(Convert.ToUInt64(eventConfig["EventCancelledChannel"]));
|
||||
if (channel != null)
|
||||
await channel.SendMessageAsync(string.Format(Messages.EventCancelled, Utils.Wrap(scheduledEvent.Name),
|
||||
eventConfig["FrowningFace"] == "true" ? $" {Messages.SettingsFrowningFace}" : ""));
|
||||
eventConfig["FrowningFace"] is "true" ? $" {Messages.SettingsFrowningFace}" : ""));
|
||||
}
|
||||
|
||||
private static async Task ScheduledEventStartedEvent(SocketGuildEvent scheduledEvent) {
|
||||
|
@ -180,4 +180,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