Compare commits

...

4 Commits

Author SHA1 Message Date
MarlaB
0b7508be8d the bot now runs but not finished 2024-03-15 15:23:59 +01:00
MarlaB
cf069a072b Merge branch 'main' of https://git.s.gbl.cz/jane/discord_susbot 2024-03-15 14:54:41 +01:00
MarlaB
f0ce5aad27 done something 2024-03-15 14:54:28 +01:00
MarlaB
024b27995a done something 2024-03-15 14:51:29 +01:00
2 changed files with 13 additions and 9 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ __pycache__/
# Sus bot data files
word_counts/
sus_bot_token.txt
.goutputstream-*
# C extensions
*.so

View File

@ -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)
@ -48,6 +48,7 @@ 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
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)
#
#