From 6cde19f3fc5a7a75415cd69b60be0ed17f1eafad Mon Sep 17 00:00:00 2001 From: iiLarsH Date: Fri, 28 Apr 2023 21:54:32 +0200 Subject: [PATCH] V1 --- bot.py | 1 + cogs/help.py | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 cogs/help.py diff --git a/bot.py b/bot.py index df0b086..23dddb7 100644 --- a/bot.py +++ b/bot.py @@ -5,6 +5,7 @@ import asyncio from discordtoken import discordtoken client = commands.Bot(command_prefix="!", intents=discord.Intents.all()) +client.remove_command('help') @client.event async def on_ready(): diff --git a/cogs/help.py b/cogs/help.py new file mode 100644 index 0000000..8fc4472 --- /dev/null +++ b/cogs/help.py @@ -0,0 +1,47 @@ +import discord +from discord.ext import commands + +class Help(commands.Cog): + def __init__(self, client): + self.client = client + + @commands.Cog.listener() + async def on_ready(self): + print("Help.py is ready") + + @commands.command() + async def help(self, ctx, message="all"): + botmessage = "" + if(message == "all"): + botmessage = str("To get further information about a command do: \n!help \n" + + "The commands you can get information on are: \n" + + "roll \n" + + "ping \n" + + "compare \n" + + "stats \n" + + "leaderboard \n"+ + "------------------- \n" + "if this help command doesnt help you or you have suggestions for future commands, ping or dm me @lars#1029") + elif(message == "roll"): + botmessage = str("!roll is a command that rolls a number between 1 and 100, with a rating") + elif(message == "ping"): + botmessage = str("!ping gives the latency between you and the bot") + elif(message == "compare"): + botmessage = str("!compare takes multiple playernames and 1 weapon to compare these players \n"+ + "Example: \n!compare iilars, legonzaur, okvdai, kraber \n!compare , , , \nA weapon doesnt need to be specified") + elif(message == "stats"): + botmessage = str("!stats takes 1 playername and 1 weapon name to show this players stats\n"+ + "Example: \n!stats iilars, kraber \n!stats , \nA weapon doesnt need to be specified\n"+ + "For those wondering why the kd with a weapon doesnt match the webclient, de webclient takes kills with a weapon and deaths to that weapon and this bot takes kills with weapon and deaths while weapon is held") + elif(message == "leaderboard"): + botmessage = str("!leaderboard is a leaderboard that can be filtered, also for the lazy between us leaderboard can be subsituted by lb, rank, ranking \n" + +"currently the leaderboard can only be filtered by kills, deaths, max_distance, total_distance with a specified weapon \n" + + "Example: \n!lb kills, kraber \n!lb , \nA weapon doesnt need to be specified") + else: + botmessage = "Cant help you with this" + + await ctx.send(f"```{botmessage}```") + + +async def setup(client): + await client.add_cog(Help(client)) \ No newline at end of file