diff --git a/.gitignore b/.gitignore index cc0735f..a8c3d61 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ __pycache__/ # Sus bot data files word_counts/ sus_bot_token.txt +.goutputstream-* # C extensions *.so diff --git a/bot_newest_version/susmain3.py b/bot_newest_version/susmain3.py index a55dece..b100bc6 100644 --- a/bot_newest_version/susmain3.py +++ b/bot_newest_version/susmain3.py @@ -7,7 +7,7 @@ t_s = 0 intents = discord.Intents.default() -intents.messages = True +intents.message_content = True intents.members = True client = commands.Bot(command_prefix = '~', intents=intents) @@ -47,7 +47,8 @@ async def word_counter(message): #counts words in word list # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -async def count_reader(message): #count command returns message with counts of certain word of all users +async def count_reader(message): #count command returns message with counts of certain word of all users + message = message.message obsah = message.content.lower().split(' ') files = [] user_counts = [] @@ -194,6 +195,7 @@ async def etime_event(message): #epoch time script # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # async def greetings_function(message): #greetings function + global t_h if t_h + 30 < time.time(): for g in greetings: if message.content.lower().startswith(g): @@ -211,6 +213,7 @@ async def greetings_function(message): #greetings function # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # async def sus_function(message): #sus function + global t_s if t_s + 20 < time.time(): if ('sus') in (message.content).lower() and message.content[0] != '~': await message.channel.send(sus_responses[random.randrange(0,len(sus_responses))]) @@ -282,20 +285,20 @@ async def on_ready(): @client.event #on message actions async def on_message(message): - global t_h, t_s if message.author == client.user: return -# else: + else: -# await(greetings_function(message)) + await greetings_function(message) -# await(sus_function(message)) + await sus_function(message) -# await(word_counter(message)) + await word_counter(message) @client.command() -async def count(ctx, *, arg): - await(count_reader(arg)) +async def count(ctx): + await ctx.send("jo") + await count_reader(ctx) # #