Beispiel #1
0
        private async Task MessageReceived(SocketMessage message)
        {
            SocketUser user = message.Author;

            //entertainment
            if (message.Content == "!flip")
            {
                Random rand = new Random();
                if (rand.Next(0, 100) > 50)
                {
                    await message.Channel.SendMessageAsync(":+1:");
                }
                else
                {
                    await message.Channel.SendMessageAsync(":-1:");
                }
            }

            string[] tokens = message.Content.Split(' ');
            string   role   = "";

            foreach (var token in tokens)
            {
                if (token != tokens[0])
                {
                    if (role != "")
                    {
                        role += " ";
                    }
                    role += token;
                }
            }

            await Administration.addRole(message, tokens, roles, role);

            await Administration.removeRole(message, tokens, role);

            await Administration.messageLogger(message, null, "recieved");

            if (user.Username == meeBot)
            {
                if (message.Content.Equals("") && message.Attachments.Count == 1)
                {
                    //foreach (var ment in message.MentionedUsers)
                    //{

                    //}
                    System.Threading.Thread.Sleep(10000);
                    await message.DeleteAsync();
                }
            }

            await addCoinAsync(user.Id);
        }
Beispiel #2
0
        private async Task MessageDeleted(Cacheable <IMessage, ulong> before, ISocketMessageChannel channel)
        {
            var message = await before.GetOrDownloadAsync();

            await Administration.messageLogger(message as SocketMessage, null, "deleted");
        }
Beispiel #3
0
        private async Task MessageUpdated(Cacheable <IMessage, ulong> before, SocketMessage after, ISocketMessageChannel channel)
        {
            var message = await before.GetOrDownloadAsync();

            await Administration.messageLogger(message as SocketMessage, after, "updated");
        }