Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Discord;
- using Discord.Commands;
- using Discord.WebSocket;
- using System.Threading.Tasks;
- namespace DiscordSelfBot {
- public class RequireOwnerAttribute : PreconditionAttribute {
- // Override the CheckPermissions method
- public async override Task<PreconditionResult> CheckPermissions(ICommandContext context, CommandInfo command, IDependencyMap map) {
- // Get the ID of the bot's owner
- //var ownerId = (await map.Get<DiscordSocketClient>().GetApplicationInfoAsync()).Owner.Id;
- var ownerId = context.Client.CurrentUser.Id;
- // If this command was executed by that user, return a success
- if (context.User.Id == ownerId)
- return PreconditionResult.FromSuccess();
- // Since it wasn't, fail
- else
- return PreconditionResult.FromError("");
- }
- }
- [RequireOwner]
- public class BotModules : ModuleBase<SocketCommandContext> {
- [Command("say"), Summary("Echos a message.")]
- public async Task Say([Remainder, Summary("The text to echo")] string echo) {
- // ReplyAsync is a method on ModuleBase
- await ReplyAsync(echo);
- }
- [Command("daddy"), Summary("Gives you a neat copypasta")]
- public async Task Daddy() {
- var message = Context.Message;
- await message.ModifyAsync(x => x.Content = System.IO.File.ReadAllText(@"C:\Users\Kupo\Documents\KupoBot\copypaste\daddy.txt"));
- }
- [Command("goodshit"), Summary("Gives you a neat copypasta")]
- public async Task GoodShit() {
- var message = Context.Message;
- await message.ModifyAsync(x => x.Content = System.IO.File.ReadAllText(@"C:\Users\Kupo\Documents\KupoBot\copypaste\goodshit.txt"));
- }
- [Command("navyseal"), Summary("Gives you a neat copypasta")]
- public async Task NavySeal() {
- var message = Context.Message;
- await message.ModifyAsync(x => x.Content = System.IO.File.ReadAllText(@"C:\Users\Kupo\Documents\KupoBot\copypaste\navyseals.txt"));
- }
- [Command("bedroom"), Summary("Gives you a neat copypasta")]
- public async Task Bedroom() {
- var message = Context.Message;
- await message.ModifyAsync(x => x.Content = System.IO.File.ReadAllText(@"C:\Users\Kupo\Documents\KupoBot\copypaste\bedroom.txt"));
- }
- [Command("bm"), Summary("Gives you a neat copypasta")]
- public async Task BrunoMars() {
- var message = Context.Message;
- await message.ModifyAsync(x => x.Content = System.IO.File.ReadAllText(@"C:\Users\Kupo\Documents\KupoBot\copypaste\bruno.txt"));
- }
- [Command("nintendo"), Summary("Gives you a neat copypasta")]
- public async Task Nintendo() {
- var message = Context.Message;
- await message.ModifyAsync(x => x.Content = System.IO.File.ReadAllText(@"C:\Users\Kupo\Documents\KupoBot\copypaste\nintendo.txt"));
- }
- [Command("confused"), Summary("Gives you a neat copypasta")]
- public async Task Confused() {
- var message = Context.Message;
- await message.ModifyAsync(x => x.Content = "\n" + "<:c1:317924541500227587><:c2:317924541915594752><:c3:317924541957537792><:c4:317924541592633346><:c5:317924541886103553>" + "\n"
- + "<:c6:317924541974446080><:c7:317924541760536588><:c8:317924541987028992><:c9:317924541735370755><:c10:317924542012063744>" + "\n"
- + "<:c11:317929336873287681><:c12:317929336915361793><:c13:317929337162694656><:c14:317929336873287691><:c15:317929337183666186>" + "\n"
- + "<:c16:317929337175146496><:c17:317929336810373132><:c18:317929337225478144><:c19:317929337192185856><:c20:317929337233997824>" + "\n"
- + "<:c21:317929337208963072><:c22:317929337275940864><:c23:317929337124945922><:c24:317929337208963073><:c25:317929336948916226>");
- }
- [Command("setgame")]
- public async Task SetGame(string game) {
- var message = Context.Message;
- await Context.Client.SetGameAsync(game);
- await message.ModifyAsync(x => x.Content = "set game to " + "\"" + game + "\"");
- }
- /*[Command("purge"), Summary("Prunes a specified number of messages.")]
- public async Task purgeMessages(uint amount) {
- var messages = await this.Context.Channel.GetMessagesAsync((int)amount + 1).Flatten();
- await this.Context.Channel.DeleteMessagesAsync(messages);
- const int delay = 5000;
- var m = await this.ReplyAsync("purge complete.");
- await Task.Delay(delay);
- await m.DeleteAsync();
- }*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement