示例#1
0
        public static async Task MainAsync(string[] args)
        {
            discord = new DiscordClient(new DiscordConfiguration
            {
                Token                 = _token,
                TokenType             = TokenType.Bot,
                UseInternalLogHandler = true,
                LogLevel              = LogLevel.Debug
            });

            commands = discord.UseCommandsNext(new CommandsNextConfiguration
            {
                StringPrefix = ".",
                EnableDms    = true
            });

            voice = discord.UseVoiceNext();

            commands.RegisterCommands <Komande>();

            //RespondNaPoruke();

            await discord.ConnectAsync();

            await Task.Delay(-1);
        }
示例#2
0
        static async Task MainAsync(string[] args)
        {
            discord = new DiscordClient(new DiscordConfiguration
            {
                Token                 = "<paste token here>",
                TokenType             = TokenType.Bot,
                UseInternalLogHandler = true,
                LogLevel              = LogLevel.Debug
            });

            commands = discord.UseCommandsNext(new CommandsNextConfiguration
            {
                StringPrefix = "!"
            });

            voice = discord.UseVoiceNext(new VoiceNextConfiguration
            {
                EnableIncoming = true
            });

            commands.RegisterCommands <MyCommands>();

            await discord.ConnectAsync();

            await Task.Delay(-1);
        }
示例#3
0
        static async Task MainAsync(string[] args)
        {
            discord = new DiscordClient(new DiscordConfiguration
            {
                Token     = DiscordoBotToken.myBotToken,
                TokenType = TokenType.Bot
            });

            commands = discord.UseCommandsNext(new CommandsNextConfiguration
            {
                StringPrefix = "!"
            });

            commands.RegisterCommands <DiscordoCommands>();

            VoiceNextConfiguration vNextConfiguration = new VoiceNextConfiguration
            {
                VoiceApplication = VoiceApplication.Music
            };

            voiceNextClient = discord.UseVoiceNext(vNextConfiguration);

            await discord.ConnectAsync();

            await Task.Delay(-1);
        }
示例#4
0
        // this instantiates the container class and the client
        public Bot(string token)
        {
            // create config from the supplied token
            var cfg = new DiscordConfiguration
            {
                Token     = token,                      // use the supplied token
                TokenType = TokenType.Bot,              // log in as a bot

                AutoReconnect         = true,           // reconnect automatically
                LogLevel              = LogLevel.Debug, // log everything
                UseInternalLogHandler = false           // we don't want the internal output logger
            };

            // initialize the client
            this.Client = new DiscordClient(cfg);

            // attach our own debug logger
            this.Client.DebugLogger.LogMessageReceived += this.DebugLogger_LogMessageReceived;

            //Setup commands module
            this.commands = this.Client.UseCommandsNext(new CommandsNextConfiguration
            {
                StringPrefix = "!"
            });

            this.commands.RegisterCommands <Commands>();

            //Setup VoiceNext module
            this.voice = this.Client.UseVoiceNext();
        }
示例#5
0
        static async Task MainAsync(string[] args)
        {
            discord = new DiscordClient(new DiscordConfiguration
            {
                Token                 = "token here",
                TokenType             = TokenType.Bot,
                UseInternalLogHandler = true,
                LogLevel              = LogLevel.Debug
            });

            commands = discord.UseCommandsNext(new CommandsNextConfiguration
            {
                StringPrefix = "~"
            });

            commands.RegisterCommands <Commands>();

            interactivity = discord.UseInteractivity(new InteractivityConfiguration());

            voice = discord.UseVoiceNext();

            discord.SetWebSocketClient <WebSocket4NetCoreClient>();

            await discord.ConnectAsync();

            await Task.Delay(-1);
        }
示例#6
0
        private static async Task MainAsync(string[] args)
        {
            DiscordClient discord = new DiscordClient(new DiscordConfiguration
            {
                Token                 = Settings.Token,
                TokenType             = TokenType.Bot,
                UseInternalLogHandler = true,
                LogLevel              = LogLevel.Debug
            });
            VoiceNextClient voice = discord.UseVoiceNext();

            Commands.Init(discord, voice);

            discord.MessageCreated += async e =>
            {
                if (e.Message.Author.Id != 420333672458354698)
                {
                    Console.WriteLine("recieved message : {0}", e.Message);
                }
            };

            CommandsNextModule commandsModule = discord.UseCommandsNext(new CommandsNextConfiguration
            {
                StringPrefix      = Settings.Prefix,
                EnableDms         = false,
                EnableDefaultHelp = false
            });

            commandsModule.RegisterCommands <Commands>();
            commandsModule.CommandErrored += Commands.Commands_CommandErrored;

            await discord.ConnectAsync();

            await Task.Delay(-1);
        }
示例#7
0
        //actual main LOL pranked.
        static async Task MainAsync(string[] args)
        {
            //create discord client.
            client = new DiscordClient(new DiscordConfiguration
            {
                Token                 = Const.Token,
                TokenType             = TokenType.Bot,
                UseInternalLogHandler = true,
                LogLevel              = LogLevel.Debug
            });

            //create voice client.
            voice = client.UseVoiceNext();

            //attach commands
            commands = client.UseCommandsNext(new CommandsNextConfiguration {
                StringPrefix = "elmar "
            });
            commands.RegisterCommands <RadioCommands>();

            //log onto discord.
            await client.ConnectAsync();

            //never close, never choose to.
            await Task.Delay(-1);
        }
示例#8
0
        public async Task Leave(CommandContext ctx)
        {
            VoiceNextClient vnext = ctx.Client.GetVoiceNextClient();

            if (vnext == null)
            {
                // not enabled
                await ctx.RespondAsync("VNext is not enabled or configured.");

                return;
            }

            // check whether we are connected

            VoiceNextConnection vnc = vnext.GetConnection(ctx.Guild);

            if (vnc == null)
            {
                // not connected
                await ctx.RespondAsync("Not connected in this guild.");

                return;
            }

            // disconnect
            vnc.Disconnect();
            await ctx.RespondAsync("Disconnected");
        }
示例#9
0
        static async Task MainAsync(string[] args)
        {
            discord = new DiscordClient(new DiscordConfiguration
            {
                Token                 = "NDEwNTk2MTYzNzM4MTQwNjg0.DVvdBA.Bd0Fe0shsW3GRujTY7WvpZcjeiA",
                TokenType             = TokenType.Bot,
                UseInternalLogHandler = true,
                LogLevel              = LogLevel.Debug
            });

            commands = discord.UseCommandsNext(new CommandsNextConfiguration
            {
                StringPrefix = ".",
                EnableDms    = false
            });
            commands.RegisterCommands <Commands>();

            voice = discord.UseVoiceNext();

            await discord.ConnectAsync();

            await Task.Delay(1000);

            await discord.UpdateStatusAsync(new DSharpPlus.Entities.DiscordGame(".all"));

            await Task.Delay(-1);
        }
示例#10
0
        static async Task MainAsync(string[] arg)
        {
            discord = new DiscordClient(new DiscordConfiguration //initializes the bot!
            {
                Token                 = "",
                TokenType             = TokenType.Bot,
                UseInternalLogHandler = true, //output all state and doings in console
                LogLevel              = LogLevel.Debug,
            });


            discord.MessageCreated += async e =>

                                      // MessageCreated is the event, += is subscribing the method to the event. When a MessageCreate event triggers, our method will run
                                      // async e is an async method. Async will run non blocking
                                      // e => is a lambda expression. It takes in input parameter e and returns with the statement

            {
                if (e.Message.Content.ToLower().StartsWith("ping"))
                {
                    // await suspends execution of this method until the task is complete.
                    // In this example, we suspend this method and wait for our message to parse.
                    // control resumes here when e.message.content.tolower().startswith is complete
                    //got em

                    await e.Message.RespondAsync("pong!");
                }
            };

            commands = discord.UseCommandsNext(new CommandsNextConfiguration //configure the prefix with the commands
            {
                StringPrefix = ".",
                EnableDms    = false
            });

            commands.RegisterCommands <MyCommands>();


            interactivity = discord.UseInteractivity(new InteractivityConfiguration //default configurations
            {
                // set default to delete reactions
                PaginationBehaviour = TimeoutBehaviour.Delete,

                // default pagination timeout to 5 minutes
                PaginationTimeout = TimeSpan.FromMinutes(1),

                // default timeout for other actions to 2 minutes
                Timeout = TimeSpan.FromMinutes(1)
            });

            voice = discord.UseVoiceNext();

            await discord.ConnectAsync(); //Have to await an async method (Also why we had to make an async main task)

            await Task.Delay(-1);         // Prevent the bot from flashing and quitting immediately
        }
示例#11
0
        public async Task RunBotAsync()
        {
            // first, let's load our configuration file
            var json = string.Empty;

            using (var fs = File.OpenRead("config.json"))
                using (var sr = new StreamReader(fs, new UTF8Encoding(false)))
                    json = await sr.ReadToEndAsync();

            // next, let's load the values from that file
            // to our client's configuration
            var cfgjson = JsonConvert.DeserializeObject <ConfigJson>(json);

            //TODO: overrite help to be more verbose, example in one of samples

            #region Client
            Client = new DiscordClient(new DiscordConfiguration
            {
                Token     = cfgjson.Token,
                TokenType = TokenType.Bot,

                AutoReconnect         = true,
                LogLevel              = LogLevel.Debug,
                UseInternalLogHandler = true
            });

            Client.ClientErrored += Client_ClientErrored;
            #endregion

            #region Commands
            Commands = Client.UseCommandsNext(new CommandsNextConfiguration
            {
                StringPrefix        = cfgjson.CommandPrefix,
                EnableDms           = false,
                EnableMentionPrefix = true
            });

            Commands.CommandExecuted += Commands_CommandExecuted;
            Commands.CommandErrored  += Commands_CommandErrored;

            Commands.RegisterCommands <Commands>();
            CommandsNextUtilities.RegisterConverter(new CommandConverters.NullableBoolConverter());
            CommandsNextUtilities.RegisterConverter(new CommandConverters.NullableIntConverter());
            #endregion

            #region Voice
            Voice = Client.UseVoiceNext(new VoiceNextConfiguration
            {
                VoiceApplication = VoiceApplication.Music
            });
            #endregion

            await Client.ConnectAsync();

            await Task.Delay(-1);
        }
示例#12
0
        public async Task MainAsync()
        {
            #region Config Stuffs
            var json = "";
            using (var fs = File.OpenRead("config.json"))
                using (var sr = new StreamReader(fs, new UTF8Encoding(false)))
                    json = await sr.ReadToEndAsync();
            var cfgJson = JsonConvert.DeserializeObject <Config>(json);
            var cfg     = new DiscordConfiguration
            {
                Token                 = cfgJson.BotToken,
                TokenType             = TokenType.Bot,
                AutoReconnect         = true,
                LogLevel              = LogLevel.Debug,
                UseInternalLogHandler = true
            };
            #endregion

            Client = new DiscordClient(cfg);
            Voice  = Client.UseVoiceNext();

            Client.Ready          += Client_Ready;
            Client.GuildAvailable += Client_GuildAvailable;
            Client.ClientErrored  += Client_ClientError;


            Client.UseInteractivity(new InteractivityConfiguration
            {
                PaginationBehaviour = TimeoutBehaviour.Ignore,
                PaginationTimeout   = TimeSpan.FromMinutes(5),
                Timeout             = TimeSpan.FromMinutes(2)
            });

            var commandcfg = new CommandsNextConfiguration
            {
                StringPrefix        = cfgJson.Prefix,
                EnableDms           = false,
                EnableMentionPrefix = true
            };

            Commands = Client.UseCommandsNext(commandcfg);
            Commands.CommandExecuted += Commands_CommandExecuted;
            Commands.CommandErrored  += Commands_CommandErrored;

            Commands.RegisterCommands <UtilityCommands>();
            Commands.RegisterCommands <Guides>();
            Commands.RegisterCommands <Music>();

            await Client.ConnectAsync();

            await Task.Delay(-1);
        }
示例#13
0
        }//end Main

        public async Task RunBotAsync()
        {
            var json = "";

            using (var fs = File.OpenRead("config.json"))
                using (var sr = new StreamReader(fs, new UTF8Encoding(false)))
                    json = await sr.ReadToEndAsync();

            var cfgjson = JsonConvert.DeserializeObject <ConfigJson>(json);
            var cfg     = new DiscordConfiguration
            {
                Token                 = cfgjson.Token,
                TokenType             = TokenType.Bot,
                AutoReconnect         = true,
                LogLevel              = LogLevel.Debug,
                UseInternalLogHandler = true
            };

            this.Client = new DiscordClient(cfg);

            //events
            this.Client.Ready              += this.Client_Ready;
            this.Client.Ready              += this.Set_Status;
            this.Client.GuildAvailable     += this.Client_GuildAvailable;
            this.Client.ClientErrored      += this.Client_ClientError;
            this.Client.ChannelPinsUpdated += this.Client_PinsUpdated;
            this.Client.PresenceUpdated    += this.Client_PresenceUpdated;

            var ccfg = new CommandsNextConfiguration
            {
                StringPrefix        = cfgjson.CommandPrefix,
                EnableDms           = false,
                EnableMentionPrefix = true,
                EnableDefaultHelp   = true
            };

            this.Commands = this.Client.UseCommandsNext(ccfg);

            this.Commands.CommandExecuted += this.Commands_CommandExecuted;
            this.Commands.CommandErrored  += this.Commands_CommandErrored;

            this.Commands.RegisterCommands <MyCommands>();

            voice = this.Client.UseVoiceNext();
            await Client.ConnectAsync();

            await Task.Delay(-1);
        }//end MainAsync
示例#14
0
        public async Task Join(CommandContext ctx, DiscordChannel chn = null)
        {
            // check whether VNext is enabled
            VoiceNextClient vnext = ctx.Client.GetVoiceNextClient();

            if (vnext == null)
            {
                // not enabled
                await ctx.RespondAsync("VNext is not enabled or configured.");

                return;
            }

            // check whether we aren't already connected
            VoiceNextConnection vnc = vnext.GetConnection(ctx.Guild);

            if (vnc != null)
            {
                // already connected
                await ctx.RespondAsync("Already connected in this guild.");

                return;
            }

            // get member's voice state
            var vstat = ctx.Member?.VoiceState;

            if (vstat?.Channel == null && chn == null)
            {
                // they did not specify a channel and are not in one
                await ctx.RespondAsync("You are not in a voice channel.");

                return;
            }

            // channel not specified, use user's
            if (chn == null)
            {
                chn = vstat.Channel;
            }

            // connect
            vnc = await vnext.ConnectAsync(chn);

            await ctx.RespondAsync($"Connected to `{chn.Name}`");
        }
示例#15
0
        public static async Task Login()
        {
            Utils.Log("Receiving token...", LogType.Console);
            Program.discord = new DiscordClient(new DiscordConfiguration()
            {
                //Token = DiscordLoginUtils.GetDiscordToken(),
                Token                 = "Mzc5NzUxMDc5MjAzNzAwNzQy.DScCfw.H5BHfhXw-ZwvN4DMgPTdmTRBJ_c",
                TokenType             = DSharpPlus.TokenType.Bot,
                LogLevel              = DSharpPlus.LogLevel.Debug,
                UseInternalLogHandler = true
            });
            await Program.WaitReceiveToken();

            Utils.Log("Received token.", LogType.Console);
            Program.SetupEvents();
            await Onno204Bot.Events.Events.RegisterEvent();

            Utils.Log("Setting up commands...", LogType.Console);
            Program.commands = Program.discord.UseCommandsNext(new CommandsNextConfiguration()
            {
                StringPrefix      = Config.CommandString,
                CaseSensitive     = false,
                EnableDefaultHelp = true
            });
            Program.commands.RegisterCommands <Commands>();
            Program.commands.CommandExecuted += new AsyncEventHandler <CommandExecutionEventArgs>(CommandsEvents.Commands_CommandExecuted);
            Utils.Log("Done Setting up commands.", LogType.Console);
            Utils.Log("Setting up Voice...", LogType.Console);
            VoiceNextConfiguration vcfg = new VoiceNextConfiguration()
            {
                EnableIncoming   = true,
                VoiceApplication = VoiceApplication.Voice
            };

            Program.Voice = Program.discord.UseVoiceNext(vcfg);
            Utils.Log("Done Setting up Voice.", LogType.Console);
            Utils.Log("Loggin in...", LogType.Console);
            await Program.discord.ConnectAsync();

            Utils.Log("Logged in.", LogType.Console);
            await Task.Delay(-1);
        }
示例#16
0
        public static async Task Play(DUser duser, bool Next = false)
        {
            MusicBot.StopPlayingJoined = false;
            VoiceNextClient vnext = duser.VNClient;

            if (vnext == null)
            {
                await DiscordUtils.SendBotMessage("VNext is not enabled or configured.", duser);
            }
            else
            {
                VoiceNextConnection vnc = duser.VNCon;
                if (vnc == null)
                {
                    await DiscordUtils.SendBotMessage(Messages.AudioNotconnectedToServer, duser);

                    await CommandFunctions.MusicJoinCh(duser);

                    await Task.Delay(200);

                    await MusicBot.Play(duser, false);
                }
                else if (Next)
                {
                    MusicBot.ThreadID.Abort();
                    await Task.Delay(1000);

                    MusicBot.ThreadID = new Thread((ThreadStart)(() => MusicBot.StartPlay(duser, false)));
                    MusicBot.ThreadID.Start();
                }
                else if (MusicBot.CurrentPlaying(duser))
                {
                    await DiscordUtils.SendBotMessage(Messages.AudioMusicAlreadyPlaying, duser);
                }
                else
                {
                    MusicBot.ThreadID = new Thread((ThreadStart)(() => MusicBot.StartPlay(duser, false)));
                    MusicBot.ThreadID.Start();
                }
            }
        }
示例#17
0
        public async Task JoinVocal(CommandContext commandContext, DiscordChannel channel = null)
        {
            VoiceNextClient voiceNext = commandContext.Client.GetVoiceNextClient();

            if (voiceNext == null)
            {
                await commandContext.RespondAsync("voiceNext == null;");

                return;
            }
            VoiceNextConnection voiceConnection = voiceNext.GetConnection(commandContext.Guild);

            if (voiceConnection != null)
            {
                await commandContext.RespondAsync("already connected");

                return;
            }
            else
            {
                await commandContext.RespondAsync("bug bug bug");
            }

            DiscordVoiceState voiceState = commandContext.Member.VoiceState;

            if (voiceState.Channel == null && channel == null)
            {
                await commandContext.RespondAsync("you're not in a voice channel");

                return;
            }

            if (channel == null)
            {
                channel = voiceState.Channel;
            }

            await commandContext.RespondAsync($"Connected to {channel.Name}");

            voiceConnection = await voiceNext.ConnectAsync(channel);
        }
示例#18
0
        static async Task MainAsync(string[] args)
        {
            discord = new DiscordClient(new DiscordConfiguration
            {
                Token                 = "",
                TokenType             = TokenType.Bot,
                UseInternalLogHandler = true,
                LogLevel              = LogLevel.Debug,
            });

            discord.UseInteractivity(new InteractivityConfiguration
            {
                // default pagination behaviour to just ignore the reactions
                PaginationBehaviour = TimeoutBehaviour.Ignore,

                // default pagination timeout to 5 minutes
                PaginationTimeout = TimeSpan.FromMinutes(5),

                // default timeout for other actions to 2 minutes
                Timeout = TimeSpan.FromMinutes(2)
            });

            commands = discord.UseCommandsNext(new CommandsNextConfiguration
            {
                StringPrefix = "!",
                EnableDms    = false
            });

            commands.RegisterCommands <EbotDsharp2.Commands>();


            voice = discord.UseVoiceNext(new VoiceNextConfiguration
            {
            });



            await discord.ConnectAsync();

            await Task.Delay(-1);
        }
示例#19
0
        static async Task MainAsync(string[] args)
        {
            KomoLogger logger = new KomoLogger();

            try
            {
                config = new JsonParser().Config;
            }
            catch (Exception e) { logger.Fatal("Loading configuration", e); }

            gameStartedDictionary = new Dictionary <DiscordMember, DateTime>();

            DiscordClient client = new DiscordClient(new DiscordConfiguration()
            {
                TokenType             = TokenType.Bot,
                Token                 = config.DiscordAPIKey,
                UseInternalLogHandler = true,
                LogLevel              = LogLevel.Debug,
            });

            WireUpEvents(client);

            voiceClient = client.UseVoiceNext();

            commands = client.UseCommandsNext(new CommandsNextConfiguration
            {
                StringPrefix      = "!",
                EnableDms         = true,
                CaseSensitive     = false,
                EnableDefaultHelp = true,
            });
            commands.RegisterCommands <Commands>();

            await client.ConnectAsync();

            await Task.Delay(5000);

            await Initialize(client, config);

            await Task.Delay(-1);
        }
示例#20
0
        public static void Init(DiscordClient client, VoiceNextClient voice)
        {
            Discord = client;
            Voice   = voice;
            _player = new Player();

            // Commands
            _searchCommand   = new Search("search");
            _startCommand    = new Start("start");
            _playCommand     = new Play("play");
            _stopCommand     = new Stop("stop");
            _joinCommand     = new Join("join");
            _leaveCommand    = new Leave("leave");
            _nextCommand     = new Next("next");
            _playListCommand = new PlayList("playlist");
            _helpCommand     = new HelpCommando("help");
            _commandList     = new List <BaseCommand>()
            {
                _joinCommand, _leaveCommand, _searchCommand, _playCommand, _nextCommand, _playListCommand, _stopCommand, _startCommand, _helpCommand
            };
        }
示例#21
0
        static async Task MainAsync(string[] args)
        {
            //DO this tutorial next: https://dsharpplus.emzi0767.com/articles/commandsnext.html
            discord = new DiscordClient(new DiscordConfiguration
            {
                Token                 = System.IO.File.ReadAllText("bot.key"),
                TokenType             = TokenType.Bot,
                UseInternalLogHandler = true,
                LogLevel              = LogLevel.Debug
            });

            discord.SetWebSocketClient <WebSocket4NetClient>();
            voice = discord.UseVoiceNext();

            await discord.ConnectAsync();

            bot = new Drifter(discord);
            await bot.Initialize();

            await Task.Delay(-1);
        }
示例#22
0
        static async Task MainAsync(string[] args)
        {
            //Создание экземпляра клиента
            discord = new DiscordClient(new DiscordConfiguration
            {
                Token                 = "NDU3NTI3NzA1NDgzODcwMjA4.DgaZfw.RfjvspNG8wln0wNISD21EeiTMmY",
                TokenType             = TokenType.Bot,
                UseInternalLogHandler = true,
                LogLevel              = LogLevel.Debug
            });

            voice = discord.UseVoiceNext();

            commands = discord.UseCommandsNext(new CommandsNextConfiguration
            {
                StringPrefix = "+++",
                EnableDms    = false
            });

            commands.RegisterCommands <MyCommands>();
            commands.RegisterCommands <GrouppedCommands>();
            commands.RegisterCommands <VoiceCommands>();
            commands.RegisterCommands <TheDivisionCommands>();

            //Обработчик асинхронного параметризированного события (Parameterized event handler)

            /*discord.MessageCreated += async e =>
             * {
             *  //if (e.Message.Content.ToLower().StartsWith("ping"))
             *  //    await e.Message.RespondAsync("pong!");
             * };*/

            await discord.ConnectAsync();

            await Task.Delay(-1);
        }
示例#23
0
        public async Task <VoiceNextConnection> RunCommand(CommandContext ctx, Player player, VoiceNextConnection connection, VoiceNextClient voice)
        {
            if (connection != null)
            {
                return(connection);
            }
            try
            {
                player.Stop();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            DiscordChannel channel = ctx.Member.VoiceState.Channel;

            if (channel == null)
            {
                await ctx.RespondAsync("You need to be in a voice channel.");
            }
            else
            {
                connection = await voice.ConnectAsync(channel);

                Console.WriteLine("connection established");
            }

            return(connection);
        }
示例#24
0
        public async Task RunBotAsync()
        {
            // first, let's load our configuration file
            var json = "";

            using (var fs = File.OpenRead("config.json"))
                using (var sr = new StreamReader(fs, new UTF8Encoding(false)))
                    json = await sr.ReadToEndAsync();

            // next, let's load the values from that file
            // to our client's configuration
            var cfgjson = JsonConvert.DeserializeObject <ConfigJson>(json);
            var cfg     = new DiscordConfiguration
            {
                Token     = cfgjson.Token,
                TokenType = TokenType.Bot,

                AutoReconnect         = true,
                LogLevel              = LogLevel.Debug,
                UseInternalLogHandler = true
            };

            // then we want to instantiate our client
            this.Client = new DiscordClient(cfg);

            // If you are on Windows 7 and using .NETFX, install
            // DSharpPlus.WebSocket.WebSocket4Net from NuGet,
            // add appropriate usings, and uncomment the following
            // line
            //this.Client.SetWebSocketClient<WebSocket4NetClient>();

            // If you are on Windows 7 and using .NET Core, install
            // DSharpPlus.WebSocket.WebSocket4NetCore from NuGet,
            // add appropriate usings, and uncomment the following
            // line
            //this.Client.SetWebSocketClient<WebSocket4NetCoreClient>();

            // If you are using Mono, install
            // DSharpPlus.WebSocket.WebSocketSharp from NuGet,
            // add appropriate usings, and uncomment the following
            // line
            //this.Client.SetWebSocketClient<WebSocketSharpClient>();

            // if using any alternate socket client implementations,
            // remember to add the following to the top of this file:
            //using DSharpPlus.Net.WebSocket;

            // next, let's hook some events, so we know
            // what's going on
            this.Client.Ready          += this.Client_Ready;
            this.Client.GuildAvailable += this.Client_GuildAvailable;
            this.Client.ClientErrored  += this.Client_ClientError;

            // up next, let's set up our commands
            var ccfg = new CommandsNextConfiguration
            {
                // let's use the string prefix defined in config.json
                StringPrefix = cfgjson.CommandPrefix,

                // enable responding in direct messages
                EnableDms = true,

                // enable mentioning the bot as a command prefix
                EnableMentionPrefix = true
            };

            // and hook them up
            this.Commands = this.Client.UseCommandsNext(ccfg);

            // let's hook some command events, so we know what's
            // going on
            this.Commands.CommandExecuted += this.Commands_CommandExecuted;
            this.Commands.CommandErrored  += this.Commands_CommandErrored;

            // up next, let's register our commands
            this.Commands.RegisterCommands <ExampleVoiceCommands>();

            // let's set up voice
            var vcfg = new VoiceNextConfiguration
            {
                VoiceApplication = VoiceApplication.Music
            };

            // and let's enable it
            this.Voice = this.Client.UseVoiceNext(vcfg);

            // finally, let's connect and log in
            await this.Client.ConnectAsync();

            // for this example you will need to read the
            // VoiceNext setup guide, and include ffmpeg.

            // and this is to prevent premature quitting
            await Task.Delay(-1);
        }
示例#25
0
        public static void addcommands(DiscordClient p_discord)
        {
            p_discord.UseCommands(new CommandConfig
            {
                Prefix  = "!",
                SelfBot = false,
            });
            UserRepository    userrepo = new UserRepository(new UserSQLContext());
            MessageRepository msgrepo  = new MessageRepository(new MessageSQLContext());

            p_discord.AddCommand("hello", async e =>
            {
                string[] msg = e.Message.Content.Split(' ');

                //if msg array contains more then 1 arrayobject then..
                if (msg.Length > 1 && msg[1].Length >= 3)

                {
                    bool ChannelContainsUser   = false;
                    List <DiscordUser> members = new List <DiscordUser>();
                    //check if member is in the current 'guild'
                    foreach (DiscordMember dm in e.Guild.Members)
                    {
                        //check if msg[1] containst a part of the user
                        if (dm.User.Username.ToUpper().Contains(msg[1].ToUpper()))
                        {
                            if (dm.User.Username.ToUpper() == msg[1].ToUpper())
                            {
                                ChannelContainsUser = true;
                                await e.Message.Respond($"{e.Message.Author.Username } says hello to <@{dm.User.ID}> ");
                                break;
                            }
                            members.Add(dm.User);
                        }
                        if (members.Count > 1 && !ChannelContainsUser)
                        {
                            await e.Message.Respond($"more then 1 user with those characters in his name");
                            ChannelContainsUser = true;
                            break;
                        }
                    }
                    if (members.Count == 1)
                    {
                        ChannelContainsUser = true;
                        await e.Message.Respond($"{e.Message.Author.Username } says hello to <@{members[0].ID}> ");
                    }
                    else if (!ChannelContainsUser)
                    {
                        await e.Message.Respond("That user is not in the current channel");
                    }
                }
                else
                {
                    await e.Message.Respond($"Hello, {e.Message.Author.Mention}!");
                }
            });
            p_discord.AddCommand("reken", async e =>
            {
                string[] msg = e.Message.Content.Split(' ');
                try
                {
                    double num1 = Convert.ToDouble(msg[1]);
                    double num2 = Convert.ToDouble(msg[3]);
                    double num3 = 1;
                    if (msg.Length > 4)
                    {
                        num3 = Convert.ToDouble(msg[4]);
                    }

                    switch (msg[2])
                    {
                    case "+":
                        await e.Message.Respond(num1.ToString() + msg[2] + num2.ToString() + '=' + (num1 + num2).ToString());
                        break;

                    case "-":
                        await e.Message.Respond(num1.ToString() + msg[2] + num2.ToString() + '=' + (num1 - num2).ToString());
                        break;

                    case "*":
                    case "x":
                        await e.Message.Respond(num1.ToString() + msg[2] + num2.ToString() + '=' + (num1 * num2).ToString());
                        break;

                    case "/":
                        await e.Message.Respond(num1.ToString() + msg[2] + num2.ToString() + '=' + (num1 / num2).ToString());
                        break;

                    case "**":
                    case "^":
                        await e.Message.Respond(num1.ToString() + msg[2] + num2.ToString() + '=' + Math.Pow(num1, num2).ToString());
                        break;

                    case "^^":
                        await e.Message.Respond(num1.ToString() + msg[2] + num2.ToString() + '=' + Math.Pow(Math.Pow(num1, num2), num3).ToString());
                        break;

                    case "%":
                        await e.Message.Respond(num1.ToString() + msg[2] + num2.ToString() + '=' + (num1 % num2).ToString());
                        break;

                    case ">":
                    case "<":
                    case "==":
                    case "!=":
                        await e.Message.Respond(msg[1] + " " + msg[2] + " " + msg[3] + " " + "= " + Operator(msg[2], num1, num2).ToString());
                        break;

                    default:
                        break;
                    }
                }
                catch (Exception exc)
                {
                    await e.Message.Respond(exc.Message);
                }
            });
            p_discord.AddCommand("join", async e =>
            {
                try
                {
                    var vcfg = new VoiceNextConfiguration
                    {
                        VoiceApplication = DSharpPlus.VoiceNext.Codec.VoiceApplication.Music
                    };
                    VoiceService = p_discord.UseVoiceNext(vcfg);

                    await VoiceService.ConnectAsync(await p_discord.GetChannelByID(272324215439491072));
                    Console.WriteLine("Joined voice channel");
                }
                catch (Exception exc)
                {
                    Console.WriteLine(exc.Message);
                }
            });
            p_discord.AddCommand("dc", async e =>
            {
                try
                {
                    DiscordGuild guild = await p_discord.GetGuild(e.Channel.GuildID);

                    VoiceService.GetConnection(guild).Disconnect();
                    VoiceService.GetConnection(guild).Dispose();
                }
                catch (Exception exc)
                {
                    Console.WriteLine(exc.Message);
                }
            });
            p_discord.AddCommand("god", async e =>
            {
                if (e.Message.Author.ID == 261216517910167554)
                {
                    await e.Message.Respond("AND THE REAL C#GOD IS....\n" + e.Message.Author.Username);
                }
                else
                {
                    await e.Message.Respond("you're not teh real c#god.");
                }
            });
            p_discord.AddCommand("kkk", async e =>
            {
                await e.Message.Respond($"WHITE POWER, RIGHT { e.Message.Author.Username }?");
            });
            p_discord.AddCommand("help", async e =>
            {
                string prefix = "!";
                await e.Message.Respond($"currently available commands are: \n{prefix}hello <username> \n{prefix}reken 'nummer' 'operator' 'nummer' \n{prefix}god to see if you are a c# god\n{prefix}karma @username to give a user karma!\n" +
                                        $"{prefix}dice 'minimumnumber' 'maximumnumber' (without the quotes) to generate a random number. {prefix}dice will automatically pick a number between 1 and 100.\n" +
                                        $"\n\nThis bot also functions as Robot9000. This means that the bot will mute you if you post duplicate content that already has been posted in this server.\n" +
                                        "The amount of time you get muted depends on the amount of punishments you already had.");
            });
            p_discord.AddCommand("666", async e =>
            {
                await e.Message.Respond("HAIL SATAN " + e.Message.Author.Username);
            });
            p_discord.AddCommand("blm", async e =>
            {
                await e.Message.Respond("BLACK HAS NO POWER, RIGHT " + e.Message.Author.Username + "?");
            });
            p_discord.AddCommand("play", async e =>
            {
                try
                {
                    DiscordGuild guild = await p_discord.GetGuild(e.Channel.GuildID);
                    var rand           = new Random();
                    var bytes          = new byte[32000];
                    rand.NextBytes(bytes);

                    await VoiceService.GetConnection(guild).SendAsync(bytes, 517, 16);
                    Console.Write("i just played something!");
                }
                catch (Exception exc)
                {
                    Console.WriteLine(exc.Message);
                }
            });
            p_discord.AddCommand("karma", async e =>
            {
                string[] msg             = e.Message.Content.Split(' ');
                List <DiscordUser> users = e.Message.Mentions;
                if (users.Count == 1)
                {
                    if (users[0].ID != e.Message.Author.ID)
                    {
                        int karma = AddKarma(users[0].ID);
                        await e.Message.Respond($"{users[0].Username} gained 1 karma!\n{users[0].Username} now has {karma} karma");
                    }
                    else
                    {
                        await e.Message.Respond($"You just lost 1 karma");
                    }
                }
                else if (users.Count > 1)
                {
                    await e.Message.Respond($"Please only mention 1 user :)");
                }
                else
                {
                    await e.Message.Respond($"You have to at least mention 1 user");
                }
            });
            p_discord.AddCommand("dice", async e =>
            {
                string[] msg = e.Message.Content.Split(' ');
                if (msg.Length > 1)
                {
                    int random = Dice(Convert.ToInt32(msg[1]), Convert.ToInt32(msg[2]));
                    await e.Message.Respond(random.ToString());
                }
                else if (msg.Length == 1)
                {
                    int random = Dice(1, 101);
                    await e.Message.Respond(random.ToString());
                }
                else
                {
                    await e.Message.Respond("Please use 2 parameters divided by a space");
                }
            });
            p_discord.AddCommand("unmute", async e =>
            {
                await Task.Delay(0);
                if (e.Message.Author.ID == 261216517910167554 || e.Message.Author.ID == 239471183475638272)
                {
                    if (e.Message.Mentions.Count > 0)
                    {
                        foreach (DiscordUser user in e.Message.Mentions)
                        {
                            new UserRepository(new UserSQLContext()).Unmute(user.ID);
                            await e.Message.Respond($"{e.Message.Author.Username } unmuted <@{user.ID}> ");
                        }
                    }
                    else
                    {
                        await e.Message.Respond($"Please mention the user(s) you want to unmute!");
                    }
                }
                else
                {
                    await e.Message.Respond($"You ar not permitted to unmute users!");
                }
            });
            p_discord.AddCommand("mutereset", async e =>
            {
                if (e.Message.Author.ID == 261216517910167554 || e.Message.Author.ID == 239471183475638272)
                {
                    if (userrepo.MuteCountreset())
                    {
                        userrepo.MuteReset();
                        await e.Message.Respond("Robot9000 mutes have been reset!");
                    }
                    else
                    {
                        await e.Message.Respond("Oops! looks like something went wrong. Please contact Mivo90");
                    }
                }
                else
                {
                    await e.Message.Respond("I'm sorry, I can not let you do that.");
                }
            });
            p_discord.AddCommand("messagereset", async e =>
            {
                if (e.Message.Author.ID == 261216517910167554 || e.Message.Author.ID == 239471183475638272)
                {
                    if (msgrepo.ResetMessages())
                    {
                        await e.Message.Respond("Robot9000 messages have been reset!");
                    }
                    else
                    {
                        await e.Message.Respond("Oops, couldn't reset the messages. Please contact Mivo90");
                    }
                }
                else
                {
                    await e.Message.Respond("Nice try.");
                }
            });
        }
示例#26
0
        static async Task MainAsync(string[] args)
        {
            discord = new DiscordClient(new DiscordConfiguration
            {
                Token                 = "private",
                TokenType             = TokenType.Bot,
                UseInternalLogHandler = true,
                LogLevel              = LogLevel.Debug
            });

            commands = discord.UseCommandsNext(new CommandsNextConfiguration
            {
                StringPrefix = "@Kirito Senpai#3481 "
            });

            discord.MessageCreated += async e =>
            {
                if (e.Message.Content.ToLower().Contains("kurwa") ||
                    e.Message.Content.ToLower().Contains("jebać") ||
                    e.Message.Content.ToLower().Contains("huj"))
                {
                    await e.Message.RespondAsync($"{e.Author.Mention}, nie przeklinaj!");

                    //    await e.Message.RespondAsync($"Abyś nauczył się dobrych manier (zanim dostaniesz bana) zostanie odebrane Ci 200 szt. Kiri-talonów");
                }
            };

            discord.MessageCreated += async e =>
            {
                string reason = null;
                if (e.Message.Content.ToLower().StartsWith("!") && e.Message.Channel.Name != "kanał-do-bota-muzycznego-d")
                {
                    await e.Message.RespondAsync($"{e.Author.Mention}, to nie jest kanał do bota muzycznego!");

                    e.Message.DeleteAsync(reason);
                }
            };



            discord.MessageCreated += async e =>
            {
                string reason = null;
                if (!e.Message.Content.Contains("!") && e.Message.Channel.Name == ("kanał-do-bota-muzycznego-d"))
                {
                    CommandContext ctx     = null;
                    string         content = ($"Warn{e.Message.Author.Mention}, pisanie na kanale do bota muzycznego");

                    if (!e.Message.Author.IsBot)
                    {
                        e.Message.DeleteAsync(reason);
                        e.Message.RespondAsync($"Warn {e.Message.Author.Mention}, pisanie na kanale do bota muzycznego!");
                    }
                    var chn = e.Channel;
                }
            };

            discord.GuildMemberAdded += async e =>
            {
                CommandContext ctx      = null;
                var            vnext    = ctx.Client.GetVoiceNextClient();
                var            chn_name = ctx.Channel.Name;

                chn_name = "Gry #1";
                string name = "Gry #2";
                var    user = ctx.Client.GetVoiceNextClient();
                //  var vstat = ctx.Member?.VoiceState;

                if ((e.Member.VoiceState.Guild.Name == chn_name) != null)
                {
                    e.Guild.CreateChannelAsync(name, type: ChannelType.Voice, parent: null, bitrate: null, user_limit: null, overwrites: null, reason: null);
                }
            };

            discord.GuildMemberAdded += async e =>
            {
                CommandContext ctx = null;
                DiscordEmbed   embed;
                bool           is_tts;
                string         content = $"Witaj w Rosyjskim Towarzystwie.";
                await e.Member.SendMessageAsync(content, is_tts = false, embed = null);

                //  string name = e.Member.name;

                DiscordMember member = e.Member;
                DiscordRole   role;
                await e.Guild.GrantRoleAsync(member, role = null, reason : null);
            };

            voice = discord.UseVoiceNext();
            commands.RegisterCommands <Commands>();
            await discord.ConnectAsync();

            await Task.Delay(-1);
        }
示例#27
0
        public async Task RunBotAsync()
        {
            //Reads the config file
            var json = "";

            using (var fs = File.OpenRead("config.json"))
                using (var sr = new StreamReader(fs, new UTF8Encoding(false)))
                    json = await sr.ReadToEndAsync();

            //reads value from the config
            //to our client config
            var cfgjson = JsonConvert.DeserializeObject <ConfigJson>(json);
            var cfg     = new DiscordConfiguration
            {
                Token     = cfgjson.Token,
                TokenType = TokenType.Bot,

                AutoReconnect         = true,
                LogLevel              = LogLevel.Debug,
                UseInternalLogHandler = true
            };

            discord = new DiscordClient(cfg);
            discord.SetWebSocketClient <WebSocket4NetClient>();

            //hooks some events, so we know
            //whats going on
            discord.Ready          += Client_Ready;
            discord.GuildAvailable += Client_GuildAvailable;
            discord.ClientErrored  += Client_ClientError;

            var ccfg = new CommandsNextConfiguration
            {
                StringPrefix        = "fulp",
                CaseSensitive       = false,
                EnableDms           = true,
                EnableMentionPrefix = true
            };

            commands = discord.UseCommandsNext(ccfg);


            discord.UseInteractivity(new InteractivityConfiguration
            {
                PaginationBehaviour = TimeoutBehaviour.Ignore,
                PaginationTimeout   = TimeSpan.FromMinutes(5),
                Timeout             = TimeSpan.FromMinutes(2)
            });

            discord.MessageCreated += async e =>
            {
                if (e.Message.Content.ToLower().StartsWith("are we talking about tom fulp"))
                {
                    await e.Message.RespondAsync("I **LOVE** talking about Tom Fulp");
                }

                if ((e.Message.Content.ToLower().StartsWith("hi") ||
                     e.Message.Content.ToLower().StartsWith("hey") ||
                     e.Message.Content.ToLower().StartsWith("heya") ||
                     e.Message.Content.ToLower().StartsWith("sup") ||
                     e.Message.Content.ToLower().StartsWith("yo") ||
                     e.Message.Content.ToLower().StartsWith("hello")) && (
                        e.Message.Content.ToLower().EndsWith("tom") ||
                        e.Message.Content.ToLower().EndsWith("fulp") ||
                        e.Message.Content.ToLower().EndsWith("tom fulp") ||
                        e.Message.Content.ToLower().EndsWith("fulperino") ||
                        e.Message.Content.ToLower().EndsWith("fulpster") ||
                        e.Message.Content.ToLower().EndsWith("fulpo")))
                {
                    await e.Message.RespondAsync("Hi friend!");
                }

                if (e.Message.Content.ToLower().StartsWith("good bot"))
                {
                    await e.Message.RespondAsync("Yeah, I know");
                }

                if (e.Message.Content.ToLower().StartsWith("shame on you") || e.Message.Content.ToLower().StartsWith(".r34"))
                {
                    if (e.Message.Content.Length > 13 && !e.Message.Content.ToLower().StartsWith(".r34"))
                    {
                        await e.Message.RespondAsync("**SHAAAAAME on " + new string(e.Message.Content.Skip(13).ToArray()) + "!!!**");
                    }
                    else
                    {
                        await e.Message.RespondAsync("**SHAAAAAME!!!**");
                    }
                }

                if (e.Message.Content.ToLower().StartsWith("lies lies lies"))
                {
                    await e.Message.RespondAsync("yeah!\n\nhttps://www.youtube.com/watch?v=v6cn0mLJVZY");
                }


                if (e.Message.Content.ToLower().EndsWith("loves lolis") ||
                    e.Message.Content.ToLower().StartsWith("i love lolis") ||
                    e.Message.Content.ToLower().EndsWith("love lolis") ||
                    e.Message.Content.ToLower().EndsWith("like lolis"))
                {
                    await e.Message.RespondAsync("me too!");

                    await e.Message.RespondWithFileAsync("images/tomloveslolis.jpg");
                }

                if (e.Message.Content.ToLower().StartsWith("i hate lolis"))
                {
                    await e.Message.RespondAsync(";(");
                }

                if (e.Message.Content.ToLower().StartsWith("what's monster mashing?"))
                {
                    await e.Message.RespondAsync("A good game fool, play it!\n\nhttps://www.newgrounds.com/portal/view/707498");
                }

                if (e.Message.Content.ToLower().StartsWith("i like trains"))
                {
                    await e.Message.RespondAsync("vroom\n\nhttps://www.newgrounds.com/portal/view/581989");
                }
            };

            commands.CommandExecuted += Commands_CommandExecuted;
            commands.CommandErrored  += Commands_CommandErrored;


            commands.RegisterCommands <MyCommands>();

            var voicecfg = new VoiceNextConfiguration
            {
                VoiceApplication = VoiceApplication.Music
            };

            voice = discord.UseVoiceNext(voicecfg);

            await discord.ConnectAsync();

            await Task.Delay(-1);
        }
示例#28
0
        public async Task RunBotAsync()
        {
            // first, let's load our configuration file
            var json = "";

            using (var fs = File.OpenRead("config.json"))
                using (var sr = new StreamReader(fs, new UTF8Encoding(false)))
                    json = await sr.ReadToEndAsync();

            // next, let's load the values from that file
            // to our client's configuration
            var cfgjson = JsonConvert.DeserializeObject <ConfigJson>(json);

            _botID    = cfgjson.Bot_ID;
            _serverID = cfgjson.Server_ID;

            var cfg = new DiscordConfiguration
            {
                Token     = cfgjson.Token,
                TokenType = TokenType.Bot,

                AutoReconnect         = true,
                LogLevel              = LogLevel.Debug,
                UseInternalLogHandler = true
            };

            // then we want to instantiate our client
            Client = new DiscordClient(cfg);

            // If you are on Windows 7 and using .NETFX, install
            // DSharpPlus.WebSocket.WebSocket4Net from NuGet,
            // add appropriate usings, and uncomment the following
            // line
            Client.SetWebSocketClient <WebSocket4NetClient>();

            // If you are on Windows 7 and using .NET Core, install
            // DSharpPlus.WebSocket.WebSocket4NetCore from NuGet,
            // add appropriate usings, and uncomment the following
            // line
            //this.Client.SetWebSocketClient<WebSocket4NetCoreClient>();

            // If you are using Mono, install
            // DSharpPlus.WebSocket.WebSocketSharp from NuGet,
            // add appropriate usings, and uncomment the following
            // line
            //this.Client.SetWebSocketClient<WebSocketSharpClient>();

            // if using any alternate socket client implementations,
            // remember to add the following to the top of this file:
            //using DSharpPlus.Net.WebSocket;

            // next, let's hook some events, so we know
            // what's going on
            Client.Ready          += Client_Ready;
            Client.GuildAvailable += Client_GuildAvailable;
            Client.ClientErrored  += Client_ClientError;
            Client.MessageCreated += Client_MessageCreated;
            //Client.GuildMemberUpdated += Client_GuildMemberUpdated;
            Client.GuildMemberAdded += Client_GuildMemberAdded;

            // let's enable interactivity, and set default options
            Client.UseInteractivity(new InteractivityConfiguration
            {
                // default pagination behaviour to just ignore the reactions
                PaginationBehaviour = TimeoutBehaviour.Ignore,

                // default pagination timeout to 5 minutes
                PaginationTimeout = TimeSpan.FromMinutes(5),

                // default timeout for other actions to 2 minutes
                Timeout = TimeSpan.FromMinutes(2)
            });

            // up next, let's set up our commands
            var ccfg = new CommandsNextConfiguration
            {
                // let's use the string prefix defined in config.json
                StringPrefix = cfgjson.CommandPrefix,

                // enable responding in direct messages
                EnableDms = true,

                // enable mentioning the bot as a command prefix
                EnableMentionPrefix = true
            };

            // let's set up voice
            var vcfg = new VoiceNextConfiguration
            {
                VoiceApplication = VoiceApplication.Music
            };

            // and hook them up
            Commands = Client.UseCommandsNext(ccfg);

            // let's hook some command events, so we know what's
            // going on
            Commands.CommandExecuted += Commands_CommandExecuted;
            Commands.CommandErrored  += Commands_CommandErrored;

            // let's add a converter for a custom type and a name
            var mathopcvt = new MathOperationConverter();

            CommandsNextUtilities.RegisterConverter(mathopcvt);
            CommandsNextUtilities.RegisterUserFriendlyTypeName <MathOperation>("operation");

            // up next, let's register our commands
            Commands.RegisterCommands <ExampleUngrouppedCommands>();
            Commands.RegisterCommands <ExampleGrouppedCommands>();
            Commands.RegisterCommands <ExampleExecutableGroup>();
            Commands.RegisterCommands <ExampleInteractiveCommands>();
            Commands.RegisterCommands <ExampleVoiceCommands>();

            // set up our custom help formatter
            Commands.SetHelpFormatter <SimpleHelpFormatter>();

            // and let's enable Voice
            Voice = Client.UseVoiceNext(vcfg);

            // finally, let's connect and log in
            await Client.ConnectAsync();

            // when the bot is running, try doing <prefix>help
            // to see the list of registered commands, and
            // <prefix>help <command> to see help about specific
            // command.

            // and this is to prevent premature quitting
            await Task.Delay(-1);
        }
示例#29
0
        static async Task MainAsync(string[]    args)
        {
            DiscordUser    complimentedCutie   = null;
            int            complimentIteration = 0;
            Random         rnd    = new Random();
            Stream         imgyus = new MemoryStream(Properties.Resources._68964a1);
            DiscordChannel currentvoicechannel = null;

            Console.WriteLine("Starting server...");
            discord = new DiscordClient(new DiscordConfiguration
            {
                Token     = "Secret Token",
                TokenType = TokenType.Bot,
            }
                                        );
            voice = discord.UseVoiceNext();
            Console.WriteLine("Initilizing Client");
            discord.Ready += async e =>
            {
                Console.WriteLine("Server Ready!");
                await discord.UpdateStatusAsync(new DiscordGame("with herself~"));
            };
            voice.Client.MessageCreated += async e =>
            {
                if (e.Message.Content.StartsWith("-"))
                {
                    String messagesent = e.Message.Content.TrimStart('-');
                    String commandsent;
                    if (messagesent.Contains(' '))
                    {
                        commandsent = messagesent.Remove(messagesent.IndexOf(' ')).Trim().ToLower();
                    }
                    else
                    {
                        commandsent = messagesent.Trim().ToLower();
                    }
                    Console.WriteLine();
                    Console.WriteLine("------------------------");
                    Console.WriteLine("Command Information:");
                    Console.WriteLine(" Sender = " + e.Author.Username);
                    Console.WriteLine(" Message = " + e.Message.Content);
                    Console.WriteLine(" Command sent = " + commandsent);
                    switch (commandsent)
                    {
                    case "compliment":
                        Console.WriteLine(" Name = Compliment");
                        switch (e.Author.Username)
                        {
                        case "SpaceCadetKitty":
                            await e.Message.RespondAsync("<@" + e.Author.Id + "> Who's a cute kitty?");

                            break;

                        case "WatermelonFennec":
                            await e.Message.RespondAsync("<@" + e.Author.Id + "> Who's a cute fennec?");

                            break;

                        case "KingMuskDeer":
                            await e.Message.RespondAsync("<@" + e.Author.Id + "> Who's a cute frumpy little deer?");

                            break;

                        case "wizard":
                            await e.Message.RespondAsync("<@" + e.Author.Id + "> Who's a cutie pie?");

                            break;

                        default:
                            await e.Message.RespondAsync("<@" + e.Author.Id + "> I'm sure you have a cute personality!");

                            break;
                        }
                        complimentedCutie   = e.Author;
                        complimentIteration = 3;
                        break;

                    case "lewd":
                        Console.WriteLine(" Name = lewd");
                        switch (e.Author.Username)
                        {
                        case "SpaceCadetKitty":
                            await e.Message.RespondAsync("*Nibbles your neck* UwU");

                            break;

                        case "WatermelonFennec":
                            await e.Message.RespondAsync("*Plays with your thingie* ^w^");

                            break;

                        case "wizard":
                            await e.Message.RespondAsync("*Licks lips* So cute!");

                            break;

                        default:
                            await e.Message.RespondAsync("UwU what's this?");

                            break;
                        }
                        break;

                    case "ping":
                        Console.WriteLine(" Name = ping");
                        await e.Message.RespondAsync($"Pong!: My ping is {discord.Ping}ms");

                        break;

                    case "blow":
                        Console.WriteLine(" Name = blow");
                        if (e.MentionedUsers.Count == 1)
                        {
                            Console.WriteLine(" Destination = " + e.MentionedUsers[0].Username);
                            if (e.MentionedUsers[0].IsBot)
                            {
                                await e.Message.RespondAsync("<@" + e.Author.Id + "> Don't be silly. You can't blow a bot!");
                            }
                            else
                            {
                                await e.Message.RespondAsync("Hear that <@" + e.MentionedUsers[0].Id + ">? <@" + e.Author.Id + "> wants to blow you!");
                            }
                        }
                        else
                        {
                            Console.WriteLine("Exception = invalid user(s)");
                        }
                        break;

                    case "cuddle":
                        List <String> discorduserslist = new List <String>();
                        Console.WriteLine(" Name = cuddle");
                        if (e.MentionedUsers.Count > 0)
                        {
                            Console.WriteLine(" Destinations:");
                            String sendingmessage = "";
                            foreach (DiscordUser usr in e.MentionedUsers)
                            {
                                if (!discorduserslist.Contains(usr.Username))
                                {
                                    Console.WriteLine("  " + usr.Username);
                                    sendingmessage += "<@" + usr.Id + ">, ";
                                    discorduserslist.Add(usr.Username);
                                }
                            }
                            sendingmessage += "<@" + e.Author.Id + "> wants to cuddle up with you!";
                            await e.Message.RespondAsync(sendingmessage);
                        }
                        else
                        {
                            Console.WriteLine("Exception = too few users");
                        }
                        List <String> cuties = new List <String>()
                        {
                            "wizard", "SpaceCadetKitty", "WatermelonFennec", "Newt_Salad"
                        };
                        if (cuties.Contains(e.Author.Username) && !(e.Author.Username.Equals("wizard") && discorduserslist.Contains("WatermelonFennec")))
                        {
                            await e.Message.RespondAsync("So cute!");
                        }
                        break;

                    case "join":
                        Console.WriteLine(" Name = join");
                        //TODO implement later
                        break;

                    case "yus":
                        Console.WriteLine(" Name = yus");
                        await e.Message.RespondWithFileAsync(imgyus, "yus.jpg");

                        break;

                    case "help":
                        Console.WriteLine(" Name = help");
                        await e.Message.RespondAsync("```css\n" +
                                                     "#The-Fennec-Bot-Commands-are\n" +
                                                     "[-compliment] The Fennec Bot will pay you a compliment!\n" +
                                                     "[-lewd] The Fennec Bot will say somthing lewd UwU\n" +
                                                     "[-ping] The Fennec Bot will tell you its ping\n" +
                                                     "[-blow @username] You blow someone, so hot!\n" +
                                                     "[-cuddle @usernames] You cuddle up with someone, or multiple people!\n" +
                                                     "[-yus] yus\n" +
                                                     "[-join] New experimental feature that will play bad songs and memes!\n" +
                                                     "[-help] The Fennec Bot will list off all the commands for you```");

                        break;

                    //TODO add elaberate help command
                    //TODO add hug command
                    //TODO add knock knock command
                    default:
                        Console.WriteLine("Exception = invalid command");
                        break;
                    }
                    Console.WriteLine("------------------------");
                }
                if (e.Message.Author.IsBot && e.Message.Content.Equals("... but you can damn well try! >:3"))
                {
                    Console.WriteLine();
                    Console.WriteLine("------------------------");
                    Console.WriteLine("CODE RED, MADELINE BOT IS BEING LEWD!!!!");
                    switch (rnd.Next(4))
                    {
                    case 0:
                        Console.WriteLine("Fire the torpedoes!");
                        await e.Message.RespondAsync("UwU");

                        break;

                    case 1:
                        Console.WriteLine("Lets get kinky!");
                        await e.Message.RespondAsync("UwU");

                        break;

                    case 2:
                        Console.WriteLine("OH F**K, OH SHIT, I DON'T KNOW WHAT TO DO!");
                        await e.Message.RespondAsync("OwO");

                        break;

                    case 3:
                        Console.WriteLine("OMG OMG SO CUTE!");
                        await e.Message.RespondAsync("OwO");

                        break;

                    default:
                        Console.WriteLine("Exception = out of bounds");
                        break;
                    }
                    Console.WriteLine("------------------------");
                }
                if (complimentedCutie != null)
                {
                    complimentIteration--;
                    if (e.Author.Equals(complimentedCutie) && e.Message.Content.ToLower().StartsWith("me"))
                    {
                        Console.WriteLine();
                        Console.WriteLine("------------------------");
                        Console.WriteLine("Complimented cutie(" + complimentedCutie.Username + ") is questioning cuteness!");
                        Console.WriteLine("Sending secondary compliment!");
                        Console.WriteLine("------------------------");
                        await e.Message.RespondAsync("<@" + complimentedCutie.Id + "> It is you! You're the cutie!");

                        complimentIteration = 0;
                    }
                    if (complimentIteration == 0)
                    {
                        complimentedCutie = null;
                    }
                }
                //TODO Later if someone tries to message the other bot and its offline, reply with "sorry this bot is offline"
            };
            await discord.ConnectAsync();

            await Task.Delay(-1);
        }