From 16c847fe98490e36f5070829434a048865a805cb Mon Sep 17 00:00:00 2001 From: Honza Date: Fri, 15 Mar 2024 18:31:29 +0100 Subject: [PATCH] added config file and tried to make loop --- bot_newest_version/config.py | 7 +++++++ bot_newest_version/susmain3.py | 31 ++++++++++++++++++++----------- 2 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 bot_newest_version/config.py diff --git a/bot_newest_version/config.py b/bot_newest_version/config.py new file mode 100644 index 0000000..9521aab --- /dev/null +++ b/bot_newest_version/config.py @@ -0,0 +1,7 @@ +slova = ["nigga", "negr", "debil", "gay", "kokot", "ok", "kurva", "sus", "petr", "gej", "bruh", "bružek"] + +sus_responses = ["it's getting sus here", "sus", "you are sussy", "sussy baka", "that is kinda sus", "that is sus", "you're seeming sus lately", "seems sus", "SUS", "gobus amogus", "amongsus", "sussy ah", "sussy"] #variety of responses when sus detection + +greetings =['čau', 'ahoj', 'hi', 'hello', 'high', 'čauky', 'nazdar', 'dobrý den','helou'] + +main_channels_ids = ["1043499633118285825", "834034469152882729"] \ No newline at end of file diff --git a/bot_newest_version/susmain3.py b/bot_newest_version/susmain3.py index d796362..a4d19e9 100644 --- a/bot_newest_version/susmain3.py +++ b/bot_newest_version/susmain3.py @@ -1,6 +1,6 @@ import discord, time, random, os -from discord.ext import commands - +from discord.ext import commands, tasks +from config import slova, sus_responses, greetings, main_channels_ids t_h = 0 t_s = 0 @@ -14,6 +14,13 @@ client = commands.Bot(command_prefix = '~', intents=intents) ############################################################################################################## ##################################### COMMNADS AND FUNCTIONS SCRIPTS ######################################### ############################################################################################################## +async def chat_participation(message): #randmonly sends messages into main channels + print("oiasndiuhsa iundhusia nhdoiusah iunasohndui sahndiu hasiduhnuiasodhna sdiyu nhasiudh niuashndiuahsniu dhniasuh") +# +# +# +# +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # async def word_counter(message): #counts words in word list for slovo in slova: if slovo in message.content.lower() and message.content[0] != '~': @@ -232,26 +239,26 @@ async def sus_function(message): #sus function else: pass -############################################################################################################## -##################################### FUNCTIONS AND COMMANDS HUB ############################################# -############################################################################################################## -slova = ["nigga", "negr", "debil", "gay", "kokot", "ok", "kurva", "sus", "petr", "gej", "bruh", "bružek"] #words bot recognize and count - -sus_responses = ["it's getting sus here", "sus", "you are sussy", "sussy baka", "that is kinda sus", "that is sus", "you're seeming sus lately", "seems sus", "SUS", "gobus amogus", "amongsus", "sussy ah", "sussy"] #variety of responses when sus detection - -greetings =['čau', 'ahoj', 'hi', 'hello', 'high', 'čauky', 'nazdar', 'dobrý den','helou'] #greetings which bot will reply to ############################################################################################################## ##################################### RUNNING THE FUNCTIONS AND COMMANDS ##################################### ############################################################################################################## +@tasks.loop(seconds = 3) +async def myloop(): + if random.randrange(0,10) == random.randrange(0,10): + for id in main_channels_ids: + channel = client.get_channel(id = id) + await channel.send(random.choice(sus_responses)) + @client.event #ready message cmd async def on_ready(): print("Logged in as {0.user}".format(client)) + myloop.start() @client.event #on message actions async def on_message(message): - if message.author == client.user: + if message.author == client.user or message.channel.id not in main_channels_ids: return else: @@ -282,5 +289,7 @@ async def primenum(ctx): async def scprove(ctx): await scprove_command(ctx.message) + + TOKEN = open("../sus_bot_token.txt", 'r').read() client.run(TOKEN)