some changes it should work
This commit is contained in:
commit
aa673b5238
@ -14,7 +14,7 @@ client = commands.Bot(command_prefix = '~', intents=intents)
|
||||
##############################################################################################################
|
||||
##################################### COMMNADS AND FUNCTIONS SCRIPTS #########################################
|
||||
##############################################################################################################
|
||||
async def word_counter(message): #counts words in word list
|
||||
async def word_counter(message): #counts words in word list
|
||||
for slovo in slova:
|
||||
if slovo in message.content.lower() and message.content[0] != '~':
|
||||
|
||||
@ -171,26 +171,22 @@ async def scprove_command(message): #scientists prove that... sc
|
||||
#
|
||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||
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)
|
||||
embed1 = discord.Embed(title = "__Commands__" ,description = None, colour=discord.Colour.red())
|
||||
embed1.set_author(name=client.user.name)
|
||||
embed1.add_field(name = "~help", value = "-- Command that will show you this list", inline = False)
|
||||
embed1.add_field(name = "~etime", value ="-- Command that will tell you the time :)", inline = False)
|
||||
embed1.add_field(name = "~scprove", value = "-- Scientist will prove you anything: ~scprove <text here>", inline = False)
|
||||
embed1.add_field(name = "~primenum", value ="-- Bot will tell you if number is a prime number", inline = False)
|
||||
embed1.add_field(name = "~count", value="-- Ask for word count of users: ~count <word>", inline = False)
|
||||
|
||||
return(embed)
|
||||
embed2 = discord.Embed(title = "__Functions__" ,description = None, colour = discord.Colour.red())
|
||||
embed2.addfield(name = "Well behaved", value="Bot will greet you back")
|
||||
embed2.addfield(name = "Significant recognicition of sussynes", value = None)
|
||||
embed2.addfield(name = "Word counting ability", value = None)
|
||||
|
||||
|
||||
# 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)
|
||||
await message.channel.send(embed = embed1)
|
||||
await message.channel.send(embed = embed2)
|
||||
|
||||
#
|
||||
#
|
||||
@ -239,52 +235,6 @@ async def sus_function(message): #sus function
|
||||
##################################### FUNCTIONS AND COMMANDS HUB #############################################
|
||||
##############################################################################################################
|
||||
|
||||
class Command:
|
||||
def __init__(self, caller, desc, script):
|
||||
self.caller = caller
|
||||
self.desc = desc
|
||||
self.script = script
|
||||
def help_print(self):
|
||||
return ('%s %s' % (self.caller, self.desc))
|
||||
|
||||
class Function:
|
||||
def __init__(self, caller, desc):
|
||||
self.caller = caller
|
||||
self.desc = desc
|
||||
def help_print(self):
|
||||
return ('%s %s' % (self.caller, self.desc))
|
||||
|
||||
|
||||
function_list = {}
|
||||
|
||||
|
||||
function_list['sus'] = Function(' sus', ' --> Bot knows when something is sus\n')
|
||||
|
||||
function_list['hello'] = Function(' greetings', ' --> Bot greets you back\n')
|
||||
|
||||
function_list['counter'] = Function(' word counter', ' --> Bot counts how many times you have written certain words')
|
||||
|
||||
command_list = {}
|
||||
|
||||
|
||||
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_command)
|
||||
|
||||
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_command)
|
||||
|
||||
command_list['~count'] = Command('~count', ' --> Ask for word count of users: |*~count <word>*|\n\n', count_reader)
|
||||
|
||||
|
||||
|
||||
slova = ["nigga", "negr", "debil", "gay", "kokot", "ok", "kurva", "sus", "petr", "gej", "bruh", "bružek"] #words bot recognize and count
|
||||
|
||||
sus_responses = ["it's getting sus here", "sus", "you are sussy", "sussy baka", "that is kinda sus", "that is sus", "you're seeming sus lately", "seems sus", "SUS", "gobus amogus", "amongsus", "sussy ah", "sussy"] #variety of responses when sus detection
|
||||
|
||||
greetings =['čau', 'ahoj', 'hi', 'hello', 'high', 'čauky', 'nazdar', 'dobrý den','helou'] #greetings which bot will reply to
|
||||
|
||||
##############################################################################################################
|
||||
##################################### RUNNING THE FUNCTIONS AND COMMANDS #####################################
|
||||
##############################################################################################################
|
||||
@ -301,18 +251,19 @@ async def on_message(message):
|
||||
else:
|
||||
|
||||
await greetings_function(message)
|
||||
|
||||
await sus_function(message)
|
||||
|
||||
await word_counter(message)
|
||||
|
||||
await client.process_commands(message) #this line is very fuqacking important
|
||||
|
||||
|
||||
@client.command()
|
||||
async def count(ctx):
|
||||
await count_reader(ctx.message)
|
||||
|
||||
@client.command()
|
||||
async def help(ctx):
|
||||
await ctx.send(help_command(ctx.message))
|
||||
async def pomoc(ctx):
|
||||
await (help_command(ctx.message))
|
||||
|
||||
@client.command()
|
||||
async def etime(ctx):
|
||||
@ -326,19 +277,5 @@ async def primenum(ctx):
|
||||
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():
|
||||
# if message.content.lower().startswith(cmd):
|
||||
# c = command_list[cmd]
|
||||
# print(message.author.name, '(id:', message.author.id, ')', 'called',c.caller)
|
||||
# await c.script(message)
|
||||
# break
|
||||
#
|
||||
# else:
|
||||
# pass
|
||||
# else:
|
||||
# pass
|
||||
|
||||
TOKEN = open("../sus_bot_token.txt", 'r').read()
|
||||
client.run(TOKEN)
|
||||
|
Loading…
Reference in New Issue
Block a user