progressed

This commit is contained in:
Honza 2024-03-15 16:02:57 +01:00
parent 0b7508be8d
commit 82e35badba

View File

@ -48,7 +48,6 @@ 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 = []
@ -111,7 +110,7 @@ async def count_reader(message): #count command returns message w
#
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
async def primenum_event(message): #primenumbers script
async def primenum_command(message): #primenumbers script
vstup = int(message.content.split("~primenum ",1)[1])
@ -158,7 +157,7 @@ async def primenum_event(message): #primenumbers script
#
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
async def scprove_event(message): #scientists prove that... script
async def scprove_command(message): #scientists prove that... script
input_message = str(message.content.split('~scprove',1)[1])
@ -171,22 +170,34 @@ async def scprove_event(message): #scientists prove that... scri
#
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
async def help_event(message): #help script
cc = ''
ff = ''
for C in command_list.values():
cc = cc + C.help_print()
for C in function_list.values():
ff = ff + C.help_print()
final_message = '**__Commands__:**\n' + cc + '**__Functions__:**\n' + ff
await message.channel.send(final_message)
async def help_command(message): #help script
embed = discord.Embed(title = "susbot" ,description = "Here is list of my commands and functions", colour=discord.Colour.red)
embed.set_author(name=client.user)
embed.add_field(name="Commands", inline = False)
embed.add_field(name="~help", value="Command that will show you this list", inline = True)
embed.add_field(name="~etime", value="Command that will tell you the time :)", inline = True)
embed.add_field(name="~scprove", value="Scientist will prove you anything: ~scprove <text here>", inline = True)
embed.add_field(name="~primenum", value="Bot will tell you if number is a prime number", inline = True)
embed.add_field(name="~count", value="Ask for word count of users: ~count <word>", inline = True)
return(embed)
# cc = ''
# ff = ''
# for C in command_list.values():
# cc = cc + C.help_print()
# for C in function_list.values():
# ff = ff + C.help_print()
# final_message = '**__Commands__:**\n' + cc + '**__Functions__:**\n' + ff
# await message.channel.send(final_message)
#
#
#
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
async def etime_event(message): #epoch time script
async def etime_command(message): #epoch time script
await message.channel.send(time.time())
#
@ -256,13 +267,13 @@ function_list['counter'] = Function(' word counter', ' --> Bot counts how man
command_list = {}
command_list['~etime'] = Command('~etime', ' --> Command that will tell you epoch time\n', etime_event)
command_list['~etime'] = Command('~etime', ' --> Command that will tell you epoch time\n', etime_command)
command_list['~help'] = Command('~help', ' --> Command that will show you this list\n', help_event)
command_list['~help'] = Command('~help', ' --> Command that will show you this list\n', help_command)
command_list['~primenum'] = Command('~primenum', ' --> Bot will tell you if number is a prime number (number of six digits max.)\n', primenum_event)
command_list['~primenum'] = Command('~primenum', ' --> Bot will tell you if number is a prime number (number of six digits max.)\n', primenum_command)
command_list['~scprove'] = Command('~scprove', ' --> Scientist will prove you anything: |*~scprove <text here>*|\n', scprove_event)
command_list['~scprove'] = Command('~scprove', ' --> Scientist will prove you anything: |*~scprove <text here>*|\n', scprove_command)
command_list['~count'] = Command('~count', ' --> Ask for word count of users: |*~count <word>*|\n\n', count_reader)
@ -297,12 +308,24 @@ async def on_message(message):
@client.command()
async def count(ctx):
await ctx.send("jo")
await count_reader(ctx)
await count_reader(ctx.message)
@client.command()
async def help(ctx):
await ctx.send(help_command(ctx.message))
@client.command()
async def etime(ctx):
await etime_command(ctx.message)
@client.command()
async def primenum(ctx):
await primenum_command(ctx.message)
@client.command()
async def scprove(ctx):
await scprove_command(ctx.message)
#
#
#
#accesing functions and commands hub to run commands
# if message.content.startswith('~'):
# for cmd in command_list.keys():