Skip to content

Instantly share code, notes, and snippets.

@simontime
Created January 14, 2019 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simontime/7c1f81bfec7bc6b45f2f5662c412ed94 to your computer and use it in GitHub Desktop.
Save simontime/7c1f81bfec7bc6b45f2f5662c412ed94 to your computer and use it in GitHub Desktop.
Sex-B-Gone Discord Bot
using DSharpPlus;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System;
using System.IO;
class Program {
static DiscordClient Client = new DiscordClient(
new DiscordConfiguration { Token = File.ReadAllText("token.txt") });
static void Main() => Bot().GetAwaiter().GetResult();
static async Task Bot() {
Client.MessageCreated += Yeet;
await Client.ConnectAsync();
Console.WriteLine("Nut detectors on");
await Task.Delay(-1);
}
static async Task Yeet(DSharpPlus.EventArgs.MessageCreateEventArgs e) {
if (Regex.IsMatch(e.Message.Content, "(?i)sex dating") ||
Regex.IsMatch(e.Message.Content, "(?i)sexdating")) {
await e.Message.DeleteAsync();
await e.Channel.SendMessageAsync($"Lol goodbye sex bot xd");
Console.WriteLine("Yeeted a sex bot in {0} lmao", e.Guild.Name);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment