]> git.taranathan.com Git - moo-bot.git/commitdiff
stops arguments from chaining
authorTaran Nathan <moogoesmeow123@gmail.com>
Mon, 24 Aug 2026 01:25:50 +0000 (18:25 -0700)
committerTaran Nathan <moogoesmeow123@gmail.com>
Mon, 24 Aug 2026 01:31:07 +0000 (18:31 -0700)
src/bot.nim

index ee3689343bcdde5effd6250981ecabd7178ce973..dc9272293694984dc527dda23e317c2646b878a3 100644 (file)
@@ -25,33 +25,33 @@ proc messageCreate(s: Shard, m: Message) {.event(discord).} =
   let
     channel = m.gchannel
 
-  if rand(100) < 02:
-    await m.react("distorted_face:1541167187694460999")
-
-  if rand(100) < 06:
+  if rand(100) < 04:
     let messages = ["gimme balls", "balls", "more balls"]
     echo "sending to balls channel"
-    discard await discord.api.sendMessage(ballsChannel, messages[rand(messages.high)])
+    discard await discord.api.sendMessage(ballsChannel, messages[rand(
+        messages.high)])
 
   if m.author.username == "mooooooo0":
-    if rand(100) < 03:
+    if rand(100) < 02:
       await m.react("🫡")
     if rand(100) < 02:
       discard await m.reply("what that guy said", mention = true)
 
   if m.referenced_message.isSome():
-    if m.referenced_message.get().author.username == "moo bot" and not (m.author.id == getOutBot):
+    if m.referenced_message.get().author.username == "moo bot" and not (
+        m.author.id == getOutBot):
       discard await m.reply("it is I", mention = true)
 
   if m.content.contains("moo") or m.content.contains("taran"):
     discard await m.reply("ig bro", mention = true)
 
-  if m.author.id == getOutBot and rand(100) < 45:
+  if m.author.id == getOutBot and (m.referenced_message.isNone or
+      m.referenced_message.get.author.username != "moo bot"):
     let responses = ["stfu bot", "get a load of this guy ^^", "NERD ALERT ðŸš¨", "stfu clanker"]
     discard await m.reply(responses[rand(responses.high)], mention = true)
 
   if rand(100) < 05:
-    let emojis = ["🥵", "🥶", "🤯", "🤓", "🫦", "🪱", "🦧"]
+    let emojis = ["🥵", "🥶", "🤯", "🤓", "🫦", "🪱", "🦧", "distorted_face:1541167187694460999"]
     await m.react(emojis[rand(emojis.high)])
 
   if m.mention_users.len > 0:
@@ -66,7 +66,7 @@ proc messageCreate(s: Shard, m: Message) {.event(discord).} =
 
 
 # Connect to Discord and run the bot.
-waitFor discord.startSession(gateway_intents={
+waitFor discord.startSession(gateway_intents = {
   giGuilds,
   giGuildEmojisAndStickers,
   giGuildMessages,
@@ -74,5 +74,5 @@ waitFor discord.startSession(gateway_intents={
   giDirectMessages,
   giDirectMessageReactions,
   giMessageContent
- }) # Don't forget to specify the gateway_intent argument and double check your priviliged intent
+  }) # Don't forget to specify the gateway_intent argument and double check your priviliged intent