Compare commits

..

No commits in common. "0b7508be8dd1aa78b988e02a25e3e45244cc3b1a" and "ad57fcadf5c1b567bc3a020948d63824ae706778" have entirely different histories.

2 changed files with 9 additions and 13 deletions

1
.gitignore vendored
View File

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

View File

@ -7,7 +7,7 @@ t_s = 0
intents = discord.Intents.default() intents = discord.Intents.default()
intents.message_content = True intents.messages = True
intents.members = True intents.members = True
client = commands.Bot(command_prefix = '~', intents=intents) client = commands.Bot(command_prefix = '~', intents=intents)
@ -47,8 +47,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 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(' ') obsah = message.content.lower().split(' ')
files = [] files = []
user_counts = [] user_counts = []
@ -195,7 +194,6 @@ async def etime_event(message): #epoch time script
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
async def greetings_function(message): #greetings function async def greetings_function(message): #greetings function
global t_h
if t_h + 30 < time.time(): if t_h + 30 < time.time():
for g in greetings: for g in greetings:
if message.content.lower().startswith(g): if message.content.lower().startswith(g):
@ -213,7 +211,6 @@ async def greetings_function(message): #greetings function
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
async def sus_function(message): #sus function async def sus_function(message): #sus function
global t_s
if t_s + 20 < time.time(): if t_s + 20 < time.time():
if ('sus') in (message.content).lower() and message.content[0] != '~': if ('sus') in (message.content).lower() and message.content[0] != '~':
await message.channel.send(sus_responses[random.randrange(0,len(sus_responses))]) await message.channel.send(sus_responses[random.randrange(0,len(sus_responses))])
@ -285,20 +282,20 @@ async def on_ready():
@client.event #on message actions @client.event #on message actions
async def on_message(message): async def on_message(message):
global t_h, t_s
if message.author == client.user: if message.author == client.user:
return 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() @client.command()
async def count(ctx): async def count(ctx, *, arg):
await ctx.send("jo") await(count_reader(arg))
await count_reader(ctx)
# #
# #