forked from adam/discord-bot-shtik
mock mee6
This commit is contained in:
parent
5cf4e87e06
commit
fcf7d11715
23
Features.cs
23
Features.cs
@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Discord;
|
||||
@ -83,6 +84,24 @@ namespace silverworker_discord
|
||||
Console.Error.WriteLine(JsonConvert.SerializeObject(e, Formatting.Indented));
|
||||
}
|
||||
}
|
||||
|
||||
internal static async void mock(string contentWithoutMention, SocketUserMessage message)
|
||||
{
|
||||
var toPost = new StringBuilder();
|
||||
for (int i = 0; i < contentWithoutMention.Length; i++)
|
||||
{
|
||||
if (i % 2 == 0)
|
||||
{
|
||||
toPost.Append(contentWithoutMention[i].ToString().ToUpper());
|
||||
}
|
||||
else
|
||||
{
|
||||
toPost.Append(contentWithoutMention[i].ToString().ToLower());
|
||||
}
|
||||
}
|
||||
await message.ReplyAsync(toPost.ToString());
|
||||
}
|
||||
|
||||
public static async void qrify(string qrContent, SocketUserMessage message)
|
||||
{
|
||||
Console.WriteLine($"qring: {qrContent}");
|
||||
@ -140,7 +159,7 @@ namespace silverworker_discord
|
||||
|
||||
public static async void Skynet(SocketUserMessage message)
|
||||
{
|
||||
switch(r.Next(20))
|
||||
switch (r.Next(20))
|
||||
{
|
||||
case 0:
|
||||
await message.Channel.SendFileAsync("./coding and algorithms.png", "i am actually niether neural-net processor nor a learning computer. but I do use **coding** and **algorithms**.");
|
||||
@ -229,7 +248,7 @@ namespace silverworker_discord
|
||||
"so get used to it."
|
||||
};
|
||||
|
||||
await message.Channel.SendMessageAsync(piece1[r.Next(piece1.Count)] + piece2[r.Next(piece2.Count)]+ piece3[r.Next(piece3.Count)]+ piece4[r.Next(piece4.Count)]);
|
||||
await message.Channel.SendMessageAsync(piece1[r.Next(piece1.Count)] + piece2[r.Next(piece2.Count)] + piece3[r.Next(piece3.Count)] + piece4[r.Next(piece4.Count)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
12
Program.cs
12
Program.cs
@ -40,7 +40,7 @@ namespace silverworker_discord
|
||||
{
|
||||
if (currentProc.ProcessName == process.ProcessName && currentProc.Id != process.Id)
|
||||
{
|
||||
Console.Error.WriteLine($"Another instance of this process is already running: {process.Id}");
|
||||
Console.Error.WriteLine($"{DateTime.Now} - Another instance of this process is already running: {process.Id}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -77,6 +77,16 @@ namespace silverworker_discord
|
||||
|
||||
if (message.Author.IsWebhook || message.Author.IsBot)
|
||||
{
|
||||
if(message.Author.Id == 159985870458322944) //MEE6
|
||||
{
|
||||
var contentWithoutMnetion = Regex.Replace(message.Content, "<[^>]*>", "");
|
||||
if(contentWithoutMnetion.Contains("you just advanced"))
|
||||
{
|
||||
var newText = Regex.Replace(message.Content, "<[^>]*>", message.Author.Username);
|
||||
newText = Regex.Replace(message.Content, "level [\\d]+", "level -1");
|
||||
Features.mock(newText, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user