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.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}");

View File

@ -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
{