diff options
| -rw-r--r-- | AleeBot/Modules/Avatar.cs | 33 | ||||
| -rw-r--r-- | AleeBot/Modules/Changelog.cs | 2 | ||||
| -rw-r--r-- | AleeBot/Modules/Help.cs | 5 | ||||
| -rw-r--r-- | AleeBot/Modules/Say.cs | 49 | ||||
| -rw-r--r-- | AleeBot/Program.cs | 2 |
5 files changed, 86 insertions, 5 deletions
diff --git a/AleeBot/Modules/Avatar.cs b/AleeBot/Modules/Avatar.cs new file mode 100644 index 0000000..a65c402 --- /dev/null +++ b/AleeBot/Modules/Avatar.cs @@ -0,0 +1,33 @@ +/******************************************* + * + * AleeBot.NET: A Discord bot that's made in Discord.NET, .NET Core 3.0 and a revival. + * Copyright (C) 2019 AleeCorp + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + **********************************************/ +using System.Threading.Tasks; +using Discord.Commands; + +namespace AleeBot.Modules +{ + public class Avatar : ModuleBase<SocketCommandContext> + { + [Command("avatar")] + public async Task AvatarAsync() + { + await ReplyAsync(Context.User.GetAvatarUrl()); + } + } +} diff --git a/AleeBot/Modules/Changelog.cs b/AleeBot/Modules/Changelog.cs index 24c0c84..38b5518 100644 --- a/AleeBot/Modules/Changelog.cs +++ b/AleeBot/Modules/Changelog.cs @@ -32,7 +32,7 @@ namespace AleeBot.Modules embed.WithTitle("AleeBot Changelog"); embed.WithColor(Color.Green); embed.WithDescription($"Changelog for AleeBot {Data.Version}"); - embed.AddField("What's new?", "- Command handler!\n- Added a uptime command\n- Revamped the help command\n- Added a changelog command"); + embed.AddField("What's new?", "- Command handler!\n- Added a uptime command\n- Revamped the help command\n- Added a changelog command\n- Added the say command (Bot owner only)\n- Added back the avatar command"); embed.WithFooter("Thanks for using AleeBot!"); await Context.Channel.SendMessageAsync(embed: embed.Build()); } diff --git a/AleeBot/Modules/Help.cs b/AleeBot/Modules/Help.cs index 612a4ce..e6d8b80 100644 --- a/AleeBot/Modules/Help.cs +++ b/AleeBot/Modules/Help.cs @@ -32,8 +32,9 @@ namespace AleeBot.Modules embed.WithTitle($"AleeBot.NET {Data.Version} Help."); embed.WithDescription($"Every command you input into AleeBot is `{Data.prefix}`"); embed.WithColor(Color.Green); - embed.AddField("Information:", "help\nping\ngit\nabout\nuptime\nchangelog"); - embed.AddField("Bot Owner Only:", "poweroff"); + embed.AddField("Information:", "help\nping\ngit\nabout\nuptime\nchangelog", true); + embed.AddField("User Information:", "avatar", true); + embed.AddField("Bot Owner Only:", "say\npoweroff", true); embed.WithFooter("AleeCorp Copyright 2012-2019"); embed.WithCurrentTimestamp(); await Context.Channel.SendMessageAsync(embed: embed.Build()); diff --git a/AleeBot/Modules/Say.cs b/AleeBot/Modules/Say.cs new file mode 100644 index 0000000..1fce97f --- /dev/null +++ b/AleeBot/Modules/Say.cs @@ -0,0 +1,49 @@ +/******************************************* + * + * AleeBot.NET: A Discord bot that's made in Discord.NET, .NET Core 3.0 and a revival. + * Copyright (C) 2019 AleeCorp + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + **********************************************/ +using Discord.Commands; +using Discord; +using System.Threading.Tasks; + +namespace AleeBot.Modules +{ + public class Say : ModuleBase<SocketCommandContext> + { + [Command("say")] + public async Task SayAsync(string echo) + { + if (Context.User.Id == 242775871059001344) + { + if (ChannelPermissions.Text.ManageMessages == false) + { + await Context.Message.DeleteAsync(); + await ReplyAsync(echo); + } + else + { + await ReplyAsync(echo); + } + } + else + { + await ReplyAsync($"{Context.User.Mention}, You don't have permissions to use this command."); + } + } + } +} diff --git a/AleeBot/Program.cs b/AleeBot/Program.cs index d307c97..c6d10f4 100644 --- a/AleeBot/Program.cs +++ b/AleeBot/Program.cs @@ -104,8 +104,6 @@ namespace AleeBot services: null); } - - private Task Log(LogMessage msg) { Console.WriteLine(msg.ToString()); |
