public async Task SyncGuild() { var guildUser = Context.User as SocketGuildUser; if (!guildUser.GuildPermissions.Administrator) { string description = $"{Global.ENo} **|** You Need the **Administrator** Permission to do that {Context.User.Username}"; var errorEmbed = EmbedHandler.CreateEmbed(Context, "Error", description, EmbedHandler.EmbedMessageType.Exception); await ReplyAndDeleteAsync("", embed : errorEmbed); } ulong In = Context.Guild.Id; string Out = Convert.ToString(In); if (!Directory.Exists(Out)) { Directory.CreateDirectory(Path.Combine(Constants.ServerUserAccountsFolder, Out)); } var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); config.GuildOwnerId = Context.Guild.Owner.Id; GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); await SendMessage(Context, null, $"Successfully synced the Guild's owner to <@{Context.Guild.OwnerId}>!"); }
public async Task SetIdIntoConfig(SocketGuildChannel chnl) { var guildUser = Context.User as SocketGuildUser; if (!guildUser.GuildPermissions.Administrator) { string description = $"{Global.ENo} **|** You Need the **Administrator** Permission to do that {Context.User.Username}"; var errorEmbed = EmbedHandler.CreateEmbed(Context, "Error", description, EmbedHandler.EmbedMessageType.Exception); await ReplyAndDeleteAsync("", embed : errorEmbed); return; } var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var response = $"Set this guild's welcome channel to #{chnl}."; config.WelcomeChannel = chnl.Id; GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); var embed = EmbedHandler.CreateEmbed(Context, "Success!", response, EmbedHandler.EmbedMessageType.Success, false); await SendMessage(Context, embed); }
public async Task RemoveWelcomeMessage(int messageIndex) { var guildUser = Context.User as SocketGuildUser; if (!guildUser.GuildPermissions.Administrator) { string description = $"{Global.ENo} **|** You Need the **Administrator** Permission to do that {Context.User.Username}"; var errorEmbed = EmbedHandler.CreateEmbed(Context, "Error", description, EmbedHandler.EmbedMessageType.Exception); await ReplyAndDeleteAsync("", embed : errorEmbed); return; } var messages = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id).WelcomeMessages; var response = $"Failed to remove this Welcome Message... Use the number shown in `welcome list` next to the `#` sign!"; if (messages.Count > messageIndex - 1) { messages.RemoveAt(messageIndex - 1); GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); response = $"Successfully removed message #{messageIndex} as possible Welcome Message!"; } var embed = EmbedHandler.CreateEmbed(Context, "Success!", response, EmbedHandler.EmbedMessageType.Success, false); await SendMessage(Context, embed); }
public async Task RemCustomCommand(string commandName) { var guildUser = Context.User as SocketGuildUser; if (!guildUser.GuildPermissions.Administrator) { string description = $"{Global.ENo} **|** You Need the **Administrator** Permission to do that {Context.User.Username}"; var errorEmbed = EmbedHandler.CreateEmbed(Context, "Error", description, EmbedHandler.EmbedMessageType.Exception); await ReplyAndDeleteAsync("", embed : errorEmbed); return; } var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var embed = new EmbedBuilder() .WithColor(Global.NayuColor); if (config.CustomCommands.Keys.Contains(commandName)) { embed.WithDescription($"Removed **{commandName}** as a command!"); config.CustomCommands.Remove(commandName); GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); } else { embed.WithDescription($"**{commandName}** isn't a command on this server."); } await SendMessage(Context, embed.Build()); }
public async Task SetServerHelperRole([Remainder] string roleName) { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); var role = Context.Guild.Roles.FirstOrDefault(x => x.Name == roleName); if (role == null) { embed.WithDescription( $"The role `{roleName}` doesn't exist on this server. Remember that this command is cAsE sEnSiTiVe."); } else { embed.WithDescription($"Set the Helper role to **{roleName}** for this server!"); config.HelperRole = role.Id; config.HelperRoleName = role.Name; GlobalGuildAccounts.SaveAccounts(); } await Context.Channel.SendMessageAsync("", embed : embed.Build()); } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }
public async Task AddWelcomeMessage([Remainder] string message) { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var guildAcc = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var response = $"Failed to add this Welcome Message..."; if (guildAcc.WelcomeMessages.Contains(message) == false) { guildAcc.WelcomeMessages.Add(message); GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); response = $"Successfully added ```\n{message}\n``` as Welcome Message!"; } await Context.Channel.SendMessageAsync(response); } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }
public async Task RemoveStringFromList([Remainder] string role) { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); if (config.SelfRoles.Contains(role)) { config.SelfRoles.Remove(role); embed.WithDescription($"Removed {role} from the Self Roles list."); GlobalGuildAccounts.SaveAccounts(); } else { embed.WithDescription("That role doesn't exist in your Guild Config."); } await Context.Channel.SendMessageAsync("", embed : embed.Build()); } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }
public async Task RemCustomCommand(string commandName) { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var embed = new EmbedBuilder() .WithColor(37, 152, 255); if (config.CustomCommands.Keys.Contains(commandName)) { embed.WithDescription($"Removed **{commandName}** as a command!"); config.CustomCommands.Remove(commandName); GlobalGuildAccounts.SaveAccounts(); } else { embed.WithDescription($"**{commandName}** isn't a command on this server."); } await Context.Channel.SendMessageAsync("", embed : embed.Build()); } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }
public async Task UnflipCMD(string arg) { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var result = ConvertBool.ConvertStringToBoolean(arg); if (result.Item1 == true) { bool argg = result.Item2; var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.WithDescription(argg ? "I'll maintain your anger! **(Enabled unflipping for this server)**" : "You may freely rampage at your own will. **(Disabled unflipping for this server)**"); config.Unflip = argg; GlobalGuildAccounts.SaveAccounts(); await Context.Channel.SendMessageAsync("", embed : embed.Build()); } if (result.Item1 == false) { await Context.Channel.SendMessageAsync($"Please say `w!uf <on/off>`"); return; } } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }
public async Task GuildUtils(SocketGuild s) { var config = GlobalGuildAccounts.GetGuildAccount(s.Id); var dmChannel = await s.Owner.GetOrCreateDMChannelAsync(); var embed = new EmbedBuilder(); embed.WithTitle($"Thanks for adding me to your server, {s.Owner.Username}!"); embed.WithDescription( "For quick information, use the `n!help` command! \nNeed quick help? Visit the my support server! https://discord.gg/z8TgwT!"); embed.WithThumbnailUrl(s.IconUrl); embed.WithFooter("Found an issue in a command? Report it in the server linked above!"); embed.WithColor(Global.NayuColor); config.GuildOwnerId = s.Owner.Id; await dmChannel.SendMessageAsync("", embed : embed.Build()); GlobalGuildAccounts.SaveAccounts(s.Id); var client = Program._client; var guilds = client.Guilds.Count; var sclient = client.Shards; //var shard = sclient. await client.SetGameAsync($"n!help | in {guilds} servers!", $"https://twitch.tv/{Config.bot.twitchStreamer}", ActivityType.Streaming); }
public async Task AddCustomCommand(string commandName, [Remainder] string commandValue) { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); config.CustomCommands.Add(commandName, commandValue); GlobalGuildAccounts.SaveAccounts(); var embed = new EmbedBuilder() .WithTitle("Custom Command Added!") .AddField("Command Name", $"__{commandName}__") .AddField("Bot Response", $"**{commandValue}**") .WithColor(37, 152, 255); await Context.Channel.SendMessageAsync("", embed : embed.Build()); } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }
public async Task RemoveStringFromList([Remainder] string role) { var guildUser = Context.User as SocketGuildUser; if (!guildUser.GuildPermissions.Administrator) { string description = $"{Global.ENo} **|** You Need the **Administrator** Permission to do that {Context.User.Username}"; var errorEmbed = EmbedHandler.CreateEmbed(Context, "Error", description, EmbedHandler.EmbedMessageType.Exception); await ReplyAndDeleteAsync("", embed : errorEmbed); return; } var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithColor(Global.NayuColor); if (config.SelfRoles.Contains(role)) { config.SelfRoles.Remove(role); embed.WithDescription($"Removed {role} from the Self Roles list."); GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); } else { embed.WithDescription("That role doesn't exist in your Guild Config."); } await SendMessage(Context, embed.Build()); }
public async Task AddStringToList([Remainder] string role) { var guildUser = Context.User as SocketGuildUser; if (!guildUser.GuildPermissions.Administrator) { string description = $"{Global.ENo} **|** You Need the **Administrator** Permission to do that {Context.User.Username}"; var errorEmbed = EmbedHandler.CreateEmbed(Context, "Error", description, EmbedHandler.EmbedMessageType.Exception); await ReplyAndDeleteAsync("", embed : errorEmbed); return; } var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var embed = new EmbedBuilder() .WithColor(Global.NayuColor) .WithDescription($"Added the {role} to the Config."); await SendMessage(Context, embed.Build()); config.SelfRoles.Add(role); GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); }
public async Task AutoRoleRoleAdd(string arg = "") { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { if (arg == null) await ReplyAndDeleteAsync("Please include the name of the role you want to autorole"); var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); config.Autorole = arg; GlobalGuildAccounts.SaveAccounts(); var embed = new EmbedBuilder(); embed.WithDescription($"Added the **{arg}** role to Autorole!"); embed.WithColor(37, 152, 255); embed.WithFooter("Make sure that Wsashi has a higher role than the autoroled role!"); await Context.Channel.SendMessageAsync("", embed: embed.Build()); } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed: embed.Build(), timeout: TimeSpan.FromSeconds(5)); } }
public async Task ClearBlacklist() { var guildUser = Context.User as SocketGuildUser; if (!guildUser.GuildPermissions.Administrator) { string description = $"{Global.ENo} **|** You Need the **Administrator** Permission to do that {Context.User.Username}"; var errorEmbed = EmbedHandler.CreateEmbed(Context, "Error", description, EmbedHandler.EmbedMessageType.Exception); await ReplyAndDeleteAsync("", embed : errorEmbed); return; } var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); config.CustomFilter.Clear(); GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithDescription("Cleared the Blacklist for this server."); embed.WithColor(Global.NayuColor); await SendMessage(Context, embed.Build()); }
public async Task RemoveStringFromBl([Remainder] string bl) { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); if (!config.CustomFilter.Contains(bl)) { embed.WithDescription($"`{bl}` isn't present in the Blacklist."); } else { embed.WithDescription($"Removed {bl} from the Blacklist."); config.CustomFilter.Remove(bl); GlobalGuildAccounts.SaveAccounts(); } await Context.Channel.SendMessageAsync("", embed : embed.Build()); } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }
public async Task AutoLewdIMG(string arg) { var guildAcc = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var result = ConvertBool.ConvertStringToBoolean(arg); if (result.Item1 == false) { await Context.Channel.SendMessageAsync($"Please say `w!autolewd <on/off>`"); return; } if (result.Item2 == true) { await Context.Channel.SendMessageAsync($"Started the AutoLewd loop :3"); await LewdLoop(Context.Message); guildAcc.AutoLewdStatus = true; GlobalGuildAccounts.SaveAccounts(); } if (result.Item2 == false) { guildAcc.AutoLewdStatus = false; GlobalGuildAccounts.SaveAccounts(); await Context.Channel.SendMessageAsync($"Stopped the AutoLewd loop :/"); } }
public async Task SetBoolIntoConfigFilter(string setting) { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var result = ConvertBool.ConvertStringToBoolean(setting); if (result.Item1 == true) { var argg = result.Item2; var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.WithDescription(argg ? ":white_check_mark: | Filter successfully turned on. Stay safe!" : ":white_check_mark: | Filter successfully turned off. Daredevil!"); await ReplyAsync("", embed : embed.Build()); var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); config.Filter = argg; GlobalGuildAccounts.SaveAccounts(); } if (result.Item1 == false) { await Context.Channel.SendMessageAsync($"Please say `w!filter <on/off>`"); return; } } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }
public async Task RemoveWelcomeMessage(int messageIndex) { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var messages = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id).WelcomeMessages; var response = $"Failed to remove this Welcome Message... Use the number shown in `welcome list` next to the `#` sign!"; if (messages.Count > messageIndex - 1) { messages.RemoveAt(messageIndex - 1); GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); response = $"Successfully removed message #{messageIndex} as possible Welcome Message!"; } await ReplyAsync(response); } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }
public async Task SyncGuild() { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var info = System.IO.Directory.CreateDirectory(Path.Combine(Constants.ResourceFolder, Constants.ServerUserAccountsFolder)); ulong In = Context.Guild.Id; string Out = Convert.ToString(In); if (!Directory.Exists(Out)) { Directory.CreateDirectory(Path.Combine(Constants.ServerUserAccountsFolder, Out)); } var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); config.GuildOwnerId = Context.Guild.Owner.Id; GlobalGuildAccounts.SaveAccounts(); await Context.Channel.SendMessageAsync($"Successfully synced the Guild's owner to <@{Context.Guild.OwnerId}>!"); } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }
public async Task AddCustomCommand(string commandName, [Remainder] string commandValue) { var guildUser = Context.User as SocketGuildUser; if (!guildUser.GuildPermissions.Administrator) { string description = $"{Global.ENo} **|** You Need the **Administrator** Permission to do that {Context.User.Username}"; var errorEmbed = EmbedHandler.CreateEmbed(Context, "Error", description, EmbedHandler.EmbedMessageType.Exception); await ReplyAndDeleteAsync("", embed : errorEmbed); return; } var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); config.CustomCommands.Add(commandName, commandValue); GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); var embed = new EmbedBuilder() .WithTitle("Custom Command Added!") .AddField("Command Name", $"__{commandName}__") .AddField("Bot Response", $"**{commandValue}**") .WithColor(Global.NayuColor); await SendMessage(Context, embed.Build()); }
public static void RemovePhrase(IGuild guild, int phraseIndex) { var guildSettings = GlobalGuildAccounts.GetGuildAccount(guild); guildSettings.RoleByPhraseSettings.RemovePhraseByIndex(phraseIndex); GlobalGuildAccounts.SaveAccounts(); }
public async Task AutoRoleRoleAdd([Remainder] string arg = "") { var guildUser = Context.User as SocketGuildUser; if (!guildUser.GuildPermissions.Administrator) { string description = $"{Global.ENo} **|** You Need the **Administrator** Permission to do that {Context.User.Username}"; var errorEmbed = EmbedHandler.CreateEmbed(Context, "Error", description, EmbedHandler.EmbedMessageType.Exception); await ReplyAndDeleteAsync("", embed : errorEmbed); return; } if (arg == null) { await ReplyAndDeleteAsync("Please include the name of the role you want to autorole"); } var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); config.AutoRole = arg; GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithDescription($"Added the **{arg}** role to AutoRole!"); embed.WithColor(Global.NayuColor); embed.WithFooter("Make sure that Nayu has a higher role than the autoroled role!"); await SendMessage(Context, embed.Build()); }
public static void RemoveRelation(IGuild guild, int phraseIndex, int roleIdIndex) { var guildSettings = GlobalGuildAccounts.GetGuildAccount(guild); guildSettings.RoleByPhraseSettings.RemoveRelation(phraseIndex, roleIdIndex); GlobalGuildAccounts.SaveAccounts(); }
public async Task CustomCurrencyCMD([Remainder] string arg) { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.WithDescription($"The server's currency is now set to the **{arg}**!"); config.Currency = arg; GlobalGuildAccounts.SaveAccounts(); await Context.Channel.SendMessageAsync("", embed : embed.Build()); if (arg == string.Empty) { await Context.Channel.SendMessageAsync($"The server currency is now set to the default **Potato** To change this, you can use `w!cc <name of your custom currency>`"); config.Currency = "Potatoes"; GlobalGuildAccounts.SaveAccounts(); } } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }
public async Task AutoLewdIMG(string arg) { var guildAcc = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var botAcc = BotAccounts.GetAccount(); var result = ConvertBool.ConvertStringToBoolean(arg); if (!result.Item1) { await SendMessage(Context, null, $"Please say `n!autolewd <on/off>`"); } else if (result.Item2) { await SendMessage(Context, null, $"Started the AutoLewd loop :3"); guildAcc.AutoLewdStatus = Enabled; botAcc.AutoLewdGuilds.Add(guildAcc.Id); GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); BotAccounts.SaveAccounts(); } else if (!result.Item2) { guildAcc.AutoLewdStatus = Disabled; botAcc.AutoLewdGuilds.Remove(guildAcc.Id); GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); BotAccounts.SaveAccounts(); await SendMessage(Context, null, $"Stopped the AutoLewd loop :/"); } }
public async Task AddWelcomeMessage([Remainder] string message) { var guildUser = Context.User as SocketGuildUser; if (!guildUser.GuildPermissions.Administrator) { string description = $"{Global.ENo} **|** You Need the **Administrator** Permission to do that {Context.User.Username}"; var errorEmbed = EmbedHandler.CreateEmbed(Context, "Error", description, EmbedHandler.EmbedMessageType.Exception); await ReplyAndDeleteAsync("", embed : errorEmbed); return; } var guildAcc = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var response = $"Failed to add this Welcome Message..."; if (guildAcc.WelcomeMessages.Contains(message) == false) { guildAcc.WelcomeMessages.Add(message); GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); response = $"Successfully added ```\n{message}\n``` as Welcome Message!"; } var embed = EmbedHandler.CreateEmbed(Context, "Success!", response, EmbedHandler.EmbedMessageType.Success, false); await SendMessage(Context, embed); }
public async Task RemoveStringFromBl([Remainder] string bl) { var guildUser = Context.User as SocketGuildUser; if (!guildUser.GuildPermissions.Administrator) { string description = $"{Global.ENo} **|** You Need the **Administrator** Permission to do that {Context.User.Username}"; var errorEmbed = EmbedHandler.CreateEmbed(Context, "Error", description, EmbedHandler.EmbedMessageType.Exception); await ReplyAndDeleteAsync("", embed : errorEmbed); return; } var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithColor(Global.NayuColor); if (!config.CustomFilter.Contains(bl)) { embed.WithDescription($"`{bl}` isn't present in the Blacklist."); } else { embed.WithDescription($"Removed {bl} from the Blacklist."); config.CustomFilter.Remove(bl); GlobalGuildAccounts.SaveAccounts(Context.Guild.Id); } await SendMessage(Context, embed.Build()); }
public async Task SetBoolToJson(string arg) { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var result = ConvertBool.ConvertStringToBoolean(arg); if (result.Item1 == true) { bool argg = result.Item2; var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.WithDescription(argg ? "Enabled mass ping checks for this server." : "Disabled mass ping checks for this server."); config.MassPingChecks = argg; GlobalGuildAccounts.SaveAccounts(); await ReplyAsync("", embed : embed.Build()); } if (result.Item1 == false) { await Context.Channel.SendMessageAsync($"Please say `w!pc <on/off>`"); return; } } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }
public async Task SetGuildPrefix([Remainder] string prefix = null) { var guser = Context.User as SocketGuildUser; if (guser.GuildPermissions.Administrator) { var config = GlobalGuildAccounts.GetGuildAccount(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); if (prefix == null) { config.CommandPrefix = "w!"; GlobalGuildAccounts.SaveAccounts(); embed.WithDescription($"Set server prefix to the default prefix **(w!)**"); } else { config.CommandPrefix = prefix; GlobalGuildAccounts.SaveAccounts(); embed.WithDescription($"Set server prefix to {prefix}"); } await Context.Channel.SendMessageAsync("", embed : embed.Build()); } else { var embed = new EmbedBuilder(); embed.WithColor(37, 152, 255); embed.Title = $":x: | You Need the Administrator Permission to do that {Context.User.Username}"; await ReplyAndDeleteAsync("", embed : embed.Build(), timeout : TimeSpan.FromSeconds(5)); } }