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
|
# Sus bot data files
|
||||||
word_counts/
|
word_counts/
|
||||||
sus_bot_token.txt
|
sus_bot_token.txt
|
||||||
|
.goutputstream-*
|
||||||
|
|
||||||
# C extensions
|
# C extensions
|
||||||
*.so
|
*.so
|
||||||
|
@ -7,7 +7,7 @@ t_s = 0
|
|||||||
|
|
||||||
|
|
||||||
intents = discord.Intents.default()
|
intents = discord.Intents.default()
|
||||||
intents.messages = True
|
intents.message_content = True
|
||||||
intents.members = True
|
intents.members = True
|
||||||
client = commands.Bot(command_prefix = '~', intents=intents)
|
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(' ')
|
obsah = message.content.lower().split(' ')
|
||||||
files = []
|
files = []
|
||||||
user_counts = []
|
user_counts = []
|
||||||
@ -194,6 +195,7 @@ 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):
|
||||||
@ -211,6 +213,7 @@ 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))])
|
||||||
@ -282,20 +285,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, *, arg):
|
async def count(ctx):
|
||||||
await(count_reader(arg))
|
await ctx.send("jo")
|
||||||
|
await count_reader(ctx)
|
||||||
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user