public async Task WhyDoYouBotherMeLol([Remainder] string oh) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); oh = oh.Replace(' ', '+'); var embed = new EmbedBuilder() .WithDescription($"http://lmgtfy.com/?q={oh}") .WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)) .WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); await ReplyAsync("", false, embed); }
public async Task Ping() { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithDescription( Bot.Internal.Utilities.GetFormattedLocaleMsg("PingCommandText", Program._client.Latency)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); await ReplyAsync("", false, embed); }
public async Task InviteUserToUseBot() { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var embed = new EmbedBuilder { Description = "Invite the bot [here](https://bot.discord.io/SIVA)" }; embed.WithFooter(Bot.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); await ReplyAsync("", false, embed); }
Calculate(string oper, int val1, int val2 = 0) //this code is f*****g nasty, i will fix it in the future. { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithTitle("Calculator"); int result; double result2; switch (oper) { case "add": result = val1 + val2; embed.WithDescription($"The answer is `{result}`"); break; case "sub": result = val1 - val2; embed.WithDescription($"The answer is `{result}`"); break; case "mult": result2 = Math.BigMul(val1, val2); embed.WithDescription($"The answer is `{result2}`"); break; case "div": Math.DivRem(val1, val2, out var b); embed.WithDescription($"The answer is `{b}`"); break; case "sqrt": result2 = Math.Sqrt(val1); embed.WithDescription($"The answer is `{result2}`"); break; case "power": result2 = Math.Pow(val1, val2); embed.WithDescription($"The answer is `{result2}`"); break; default: embed.WithDescription( "You didn't specify a valid operation. Valid operations are `add`, `sub`, `mult`, `div`, `power`, and `sqrt`."); break; } await ReplyAsync("", false, embed); }
public async Task ModifyServerName([Remainder] string name) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); await Context.Guild.ModifyAsync(x => x.Name = name); var embed = new EmbedBuilder(); embed.WithDescription($"Set this server's name to **{name}**!"); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); await SendMessage(embed); }
public async Task GiveUserMoney(SocketGuildUser user, int amt) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var embed = new EmbedBuilder(); var acc = UserAccounts.GetAccount(user); acc.Money += amt; UserAccounts.SaveAccounts(); embed.WithDescription($"{amt} added to **{user.Username}#{user.Discriminator}**'s balance."); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); await SendMessage(embed); }
public async Task HelpCommand() { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithFooter(Bot.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithDescription(Bot.Utilities.GetFormattedLocaleMsg("HelpString")); await Context.Message.AddReactionAsync(new Emoji("☑")); var dm = await Context.User.GetOrCreateDMChannelAsync(); await dm.SendMessageAsync("", false, embed); }
public async Task ClearBlacklist() { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); config.Blacklist.Clear(); GuildConfig.SaveGuildConfig(); var embed = new EmbedBuilder(); embed.WithDescription("Cleared the Blacklist for this server."); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); await SendMessage(embed); }
public async Task AddStringToBl([Remainder] string bl) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); config.Blacklist.Add(bl); GuildConfig.SaveGuildConfig(); var embed = new EmbedBuilder(); embed.WithDescription($"Added {bl} to the Blacklist."); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); await SendMessage(embed); }
public async Task AddCustomCommand(string commandName, [Remainder] string commandValue) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); config.CustomCommands.Add(commandName, commandValue); GuildConfig.SaveGuildConfig(); var embed = new EmbedBuilder() .AddField("Command Name", $"__{commandName}__") .AddField("Bot Response", $"**{commandValue}**") .WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)) .WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); await SendMessage(embed); }
public async Task BanThenUnbanUser(SocketGuildUser user) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithDescription($"{Context.User.Mention} softbanned <@{user.Id}>, deleting the last 7 days of messages from that user."); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithFooter(Bot.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); await ReplyAsync("", false, embed); await Context.Guild.AddBanAsync(user, 7); await Context.Guild.RemoveBanAsync(user); }
public async Task UserInformationCommand(SocketGuildUser user = null) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var embed = new EmbedBuilder(); if (user != null) { embed.AddField("Username", $"{user.Username}#{user.Discriminator}"); embed.AddField("User ID", user.Id); if (user.Game != null) { embed.AddField("Game", user.Game); } else { embed.AddField("Game", "Nothing"); } embed.AddField("Status", user.Status); embed.AddField("Account Created", user.CreatedAt.UtcDateTime); embed.WithThumbnailUrl(user.GetAvatarUrl()); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithTitle("User Information"); embed.AddField("Is Bot", user.IsBot); } else { embed.AddField("Username", $"{Context.User.Username}#{Context.User.Discriminator}"); embed.AddField("User ID", Context.User.Id); if (Context.User.Game != null) { embed.AddField("Game", Context.User.Game); } else { embed.AddField("Game", "Nothing"); } embed.AddField("Status", Context.User.Status); embed.AddField("Account Created", Context.User.CreatedAt.UtcDateTime); embed.WithThumbnailUrl(Context.User.GetAvatarUrl()); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithTitle("User Information"); embed.AddField("Is Bot", Context.User.IsBot); } await ReplyAsync("", false, embed); }
public async Task AutoRoleRoleAdd([Remainder] string arg = "") { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); config.Autorole = arg; GuildConfig.SaveGuildConfig(); var embed = new EmbedBuilder(); embed.WithDescription(Bot.Internal.Utilities.GetFormattedLocaleMsg("AutoroleCommandText", arg)); embed.WithThumbnailUrl(Context.Guild.IconUrl); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); await SendMessage(embed); }
public async Task TakeAwaySpecifiedRole(SocketGuildUser user, [Remainder] string role) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var targetRole = user.Guild.Roles.FirstOrDefault(r => r.Name == role); var embed = new EmbedBuilder(); embed.WithFooter(Bot.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithDescription(Bot.Utilities.GetFormattedLocaleMsg("RemRoleCommandText", role, user.Username + "#" + user.Discriminator)); await user.RemoveRoleAsync(targetRole); await ReplyAsync("", false, embed); }
public async Task Google([Remainder] string search) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); search = search.Replace(' ', '+'); string searchUrl = $"https://google.com/search?q={search}"; var embed = new EmbedBuilder(); embed.WithDescription(searchUrl); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithThumbnailUrl("https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Google_%22G%22_Logo.svg/2000px-Google_%22G%22_Logo.svg.png"); await ReplyAsync("", false, embed); }
public async Task SearchYouTube([Remainder] string query) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithThumbnailUrl("https://www.freepnglogos.com/uploads/youtube-logo-hd-8.png"); var url = "https://youtube.com/results?search_query="; var newQuery = query.Replace(' ', '+'); embed.WithDescription(url + newQuery); await ReplyAsync("", false, embed); }
public async Task SetServerLoggingChannel(bool isEnabled, SocketTextChannel chnl = null) { string lol; var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); lol = isEnabled ? "Enabled server logging" : "Disabled server logging"; if (chnl == null) { chnl = (SocketTextChannel)Context.Channel; } config.IsServerLoggingEnabled = isEnabled; config.ServerLoggingChannel = chnl.Id; GuildConfig.SaveGuildConfig(); var embed = Helpers.CreateEmbed(Context, $"{lol}, and set the channel to <#{chnl.Id}>."); await Helpers.SendMessage(Context, embed); }
public async Task PickOne([Remainder] string message) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); string[] options = message.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); Random r = new Random(); string selection = options[r.Next(0, options.Length)]; var embed = new EmbedBuilder(); embed.WithDescription(Bot.Utilities.GetFormattedLocaleMsg("PickCommandText", selection)); embed.WithFooter(Bot.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); await ReplyAsync("", false, embed); }
public async Task Fortnite(FortniteApi.Data.Platform platform, [Remainder] string name) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var fortnite = new FortniteClient("b226f694-eb4a-4e09-99d2-0639bf57ea90"); var profile = await fortnite.FindPlayerAsync(platform, name); var embed = new EmbedBuilder(); embed.WithTitle($"{name}'s Fortnite Info - {platform}"); embed.WithFooter(Bot.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.AddField("Account ID", profile.AccountId); embed.AddField("Platform", profile.PlatformName); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithThumbnailUrl("https://cdn.atr.cloud/monthly_2017_10/FortniteClient-Win64-Shipping_123.ico_256x256.png.9db57869789ecc4d9c5f72c5a9ba9e30.thumb.png.d8d082ccd47b246fc3773e854b1b2ead.png"); await ReplyAsync("", false, embed); }
public async Task LoadDareFromJson() { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); if (!config.IsTodEnabled) { return; } var json = TruthOrDareJson.LoadJson(); var r = new Random().Next(0, json.Dares.Count); var daresList = json.Dares.ToArray(); var dare = daresList[r]; var embed = Helpers.CreateEmbed(Context, dare); await Helpers.SendMessage(Context, embed); }
public async Task BanUserById(ulong userid, [Remainder] string reason = "") { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); if (reason == "") { reason = $"Banned by {Context.User.Username}#{Context.User.Discriminator}"; } await Context.Guild.AddBanAsync(userid, 7, reason); var embed = new EmbedBuilder(); embed.WithDescription(Bot.Utilities.GetFormattedLocaleMsg("BanText", $"<@{userid}>", $"<@{Context.User.Id}>")); embed.WithFooter(Bot.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); await ReplyAsync("", false, embed); }
public async Task KickUser(SocketGuildUser user, [Remainder] string reason = "") { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); if (Helpers.UserHasRole(Context, config.ModRole)) { await user.KickAsync(reason); var embed = Helpers.CreateEmbed(Context, Bot.Internal.Utilities.GetFormattedLocaleMsg("KickUserMsg", user.Mention, Context.User.Mention)); await Helpers.SendMessage(Context, embed); } else { var e = Helpers.CreateEmbed(Context, Bot.Internal.Utilities.GetFormattedLocaleMsg("NotEnoughPermission", Context.User.Username)); await Helpers.SendMessage(Context, e); } }
public async Task OverwatchPlayer(string gamer) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var owClient = new OverwatchClient(); Player player = await owClient.GetPlayerAsync(gamer); var embed = new EmbedBuilder(); embed.WithTitle($"{gamer}'s Overwatch \"stats\"!"); embed.AddField("Level", player.PlayerLevel); embed.AddField("Platform", player.Platform); embed.AddField("Profile URL", player.ProfileUrl); embed.AddField("Achievements", player.Achievements.Count); embed.WithThumbnailUrl(player.CompetitiveRankImageUrl); embed.WithFooter(Bot.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); await ReplyAsync("", false, embed); }
public async Task BanThenUnbanUser(SocketGuildUser user) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); if (Helpers.UserHasRole(Context, config.ModRole)) { var embed = Helpers.CreateEmbed(Context, $"{Context.User.Mention} softbanned <@{user.Id}>, deleting the last 7 days of messages from that user."); await Helpers.SendMessage(Context, embed); await Context.Guild.AddBanAsync(user, 7); await Context.Guild.RemoveBanAsync(user); } else { var e = Helpers.CreateEmbed(Context, Bot.Internal.Utilities.GetFormattedLocaleMsg("NotEnoughPermission", Context.User.Username)); await Helpers.SendMessage(Context, e); } }
public async Task SayCommand([Remainder] string message) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithDescription(message); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); await Context.Message.DeleteAsync(); if (Config.bot.Debug) { Console.WriteLine($"DEBUG: {Context.User.Username}#{Context.User.Discriminator} used the say command in the channel #{Context.Channel.Name} and said \"{message}\"."); await ReplyAsync("", false, embed); } else { await ReplyAsync("", false, embed); } }
public async Task BanUser(SocketGuildUser user, [Remainder] string reason = "Banned by a moderator.") { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); if (Helpers.UserHasRole(Context, config.ModRole)) { await Context.Guild.AddBanAsync(user, 7, reason); var embed = new EmbedBuilder(); embed.WithDescription(Bot.Internal.Utilities.GetFormattedLocaleMsg("BanText", user.Mention, Context.User.Mention)); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); await ReplyAsync("", false, embed); } else { var e = Helpers.CreateEmbed(Context, Bot.Internal.Utilities.GetFormattedLocaleMsg("NotEnoughPermission", Context.User.Username)); await Helpers.SendMessage(Context, e); } }
public async Task DisableSlashEnableTod(bool setting) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); config.IsTodEnabled = setting; GuildConfig.SaveGuildConfig(); var embed = new EmbedBuilder() .WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)) .WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); if (setting) { embed.WithDescription("Enabled Truth or Dare for this server."); } if (setting == false) { embed.WithDescription("Disabled Truth or Dare for this server."); } await ReplyAsync("", false, embed); }
public async Task RemoveStringFromBl([Remainder] string bl) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); if (!config.Blacklist.Contains(bl)) { embed.WithDescription($"`{bl}` isn't present in the Blacklist."); } else { embed.WithDescription($"Removed {bl} from the Blacklist."); config.Blacklist.Remove(bl); GuildConfig.SaveGuildConfig(); } await SendMessage(embed); }
public async Task SendFeedbackToDev([Remainder] string feedback) { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithDescription(Bot.Internal.Utilities.GetFormattedLocaleMsg("FeedbackCommandText", feedback)); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); embed.WithTitle("Feedback to Greem"); await ReplyAsync("", false, embed); var feedbackEmbed = new EmbedBuilder() .WithDescription(feedback) .WithTitle($"Feedback from {Context.User.Username}#{Context.User.DiscriminatorValue}") .WithColor(Bot.Internal.Config.bot.DefaultEmbedColour); var channel = Bot.Internal.Program._client.GetGuild(405806471578648588).GetTextChannel(415182876326232064); await channel.SendMessageAsync("", false, feedbackEmbed); }
public async Task ServerInformationCommand() { var config = GuildConfig.GetOrCreateConfig(Context.Guild.Id); var embed = new EmbedBuilder(); embed.WithTitle("Server Information"); embed.AddField("Name", Context.Guild.Name); embed.AddField("Created", Context.Guild.CreatedAt.UtcDateTime); embed.AddField("Users", Context.Guild.Users.Count); embed.AddField("Text Channels", Context.Guild.TextChannels.Count); embed.AddField("Voice Channels", Context.Guild.VoiceChannels.Count); embed.AddField("Region", Context.Guild.VoiceRegionId); embed.WithThumbnailUrl(Context.Guild.IconUrl); embed.AddField("Roles", Context.Guild.Roles.Count); embed.AddField("Donator Guild", config.VerifiedGuild); embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username)); embed.WithColor(new Color(config.EmbedColour1, config.EmbedColour2, config.EmbedColour3)); await ReplyAsync("", false, embed); }