Compare commits

...

2 Commits

Author SHA1 Message Date
MarlaB
2d181070cc now it is working brh 2024-03-15 17:30:43 +01:00
MarlaB
6e75260378 dasdasoihjdosa 2024-03-15 16:52:38 +01:00

View File

@ -14,7 +14,7 @@ client = commands.Bot(command_prefix = '~', intents=intents)
############################################################################################################## ##############################################################################################################
##################################### COMMNADS AND FUNCTIONS SCRIPTS ######################################### ##################################### 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: for slovo in slova:
if slovo in message.content.lower() and message.content[0] != '~': if slovo in message.content.lower() and message.content[0] != '~':
@ -171,27 +171,18 @@ async def scprove_command(message): #scientists prove that... sc
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
async def help_command(message): #help script 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) embed1 = discord.Embed(title = "__Commands__" ,description = None, colour=discord.Colour.red())
embed.set_author(name=client.user) embed1.set_author(name=client.user.name)
embed.add_field(name="Commands", inline = False) embed1.add_field(name="~help", value="-- Command that will show you this list", inline = False)
embed.add_field(name="~help", value="Command that will show you this list", inline = True) embed1.add_field(name="~etime", value="-- Command that will tell you the time :)", inline = False)
embed.add_field(name="~etime", value="Command that will tell you the time :)", inline = True) embed1.add_field(name="~scprove", value="-- Scientist will prove you anything: ~scprove <text here>", inline = False)
embed.add_field(name="~scprove", value="Scientist will prove you anything: ~scprove <text here>", inline = True) embed1.add_field(name="~primenum", value="-- Bot will tell you if number is a prime number", inline = False)
embed.add_field(name="~primenum", value="Bot will tell you if number is a prime number", inline = True) embed1.add_field(name="~count", value="-- Ask for word count of users: ~count <word>", inline = False)
embed.add_field(name="~count", value="Ask for word count of users: ~count <word>", inline = True)
return(embed) embed2 = discord.Embed(title = "__Functions__" ,description = None, colour=discord.Colour.red())
embed.addfield(name="")
await message.channel.send(embed=embed1)
# 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)
# #
# #
# #
@ -239,46 +230,6 @@ async def sus_function(message): #sus function
##################################### FUNCTIONS AND COMMANDS HUB ############################################# ##################################### 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 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 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
@ -301,18 +252,19 @@ async def on_message(message):
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)
await client.process_commands(message)
@client.command() @client.command()
async def count(ctx): async def count(ctx):
await count_reader(ctx.message) await count_reader(ctx.message)
@client.command() @client.command()
async def help(ctx): async def pomoc(ctx):
await ctx.send(help_command(ctx.message)) await (help_command(ctx.message))
@client.command() @client.command()
async def etime(ctx): async def etime(ctx):
@ -326,19 +278,5 @@ async def primenum(ctx):
async def scprove(ctx): async def scprove(ctx):
await scprove_command(ctx.message) 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() TOKEN = open("../sus_bot_token.txt", 'r').read()
client.run(TOKEN) client.run(TOKEN)