the bot now runs but not finished
This commit is contained in:
parent
cf069a072b
commit
0b7508be8d
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,6 +7,7 @@ __pycache__/
|
||||
# Sus bot data files
|
||||
word_counts/
|
||||
sus_bot_token.txt
|
||||
.goutputstream-*
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
@ -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)
|
||||
|
||||
#
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user