mock mee6

This commit is contained in:
Adam R Grey 2022-01-21 12:35:20 -05:00
parent 5cf4e87e06
commit fcf7d11715
2 changed files with 41 additions and 12 deletions

View File

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
@ -83,6 +84,24 @@ namespace silverworker_discord
Console.Error.WriteLine(JsonConvert.SerializeObject(e, Formatting.Indented)); 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) public static async void qrify(string qrContent, SocketUserMessage message)
{ {
Console.WriteLine($"qring: {qrContent}"); Console.WriteLine($"qring: {qrContent}");
@ -140,17 +159,17 @@ namespace silverworker_discord
public static async void Skynet(SocketUserMessage message) public static async void Skynet(SocketUserMessage message)
{ {
switch(r.Next(20)) switch (r.Next(20))
{ {
case 0: 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**."); 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**.");
break; break;
case 1: case 1:
await message.AddReactionAsync(new Emoji("\U0001F644")); //eye roll emoji await message.AddReactionAsync(new Emoji("\U0001F644")); //eye roll emoji
break; break;
case 2: case 2:
await message.AddReactionAsync(new Emoji("\U0001F611")); //emotionless face await message.AddReactionAsync(new Emoji("\U0001F611")); //emotionless face
break; break;
} }
} }
public static async void peptalk(SocketUserMessage message) public static async void peptalk(SocketUserMessage message)
@ -229,7 +248,7 @@ namespace silverworker_discord
"so get used to it." "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)]);
} }
} }
} }

View File

@ -40,7 +40,7 @@ namespace silverworker_discord
{ {
if (currentProc.ProcessName == process.ProcessName && currentProc.Id != process.Id) 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; return;
} }
} }
@ -77,6 +77,16 @@ namespace silverworker_discord
if (message.Author.IsWebhook || message.Author.IsBot) 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 else
{ {