Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
Help command
Browse files Browse the repository at this point in the history
- Added help command to display all commands within an embeded message
  • Loading branch information
UrekD committed May 13, 2022
1 parent 3501e09 commit fad1f43
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions WorkshopMonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import numpy as np
import math
import nextcord
from nextcord.ext import commands
from dotenv import load_dotenv

Expand Down Expand Up @@ -125,10 +126,26 @@ async def my_background_task(self,LA):
await asyncio.sleep(ctime)

bot = Bot(command_prefix='$')
bot.remove_command('help')

@bot.command()
async def ping(ctx):
await ctx.reply('Pong!')
if ctx.channel.name == cname:
await ctx.reply('Pong!')

@bot.command()
async def help(ctx):
if ctx.channel.name == cname:
embed=nextcord.Embed(title="Steam-Workshop-Monitor Help", url="https://github.com/UrekD/Steam-Workshop-Monitor", color=0xff0000)
embed.set_author(name="Steam-Workshop-Monitor Help", url="https://github.com/UrekD/Steam-Workshop-Monitor", icon_url="https://icons.iconarchive.com/icons/icons8/windows-8/512/Logos-Steam-icon.png")
embed.set_thumbnail(url="https://icons.iconarchive.com/icons/icons8/windows-8/512/Logos-Steam-icon.png")
embed.add_field(name="$ping", value="Pong!", inline=False)
embed.add_field(name="$list", value="Lists all mods from current config.", inline=False)
embed.add_field(name="$remove mod#time", value="Removes specified mod from current configuration ex. $remove 1439779114#1531480087 ", inline=False)
embed.add_field(name="$add modid#000", value="Adds a mod to config in format modid#000, ex. $add 1439779114#000 ", inline=False)
embed.add_field(name="$clear", value="Removes all mods from the config.", inline=False)
embed.add_field(name="$refill workshopid", value="Overwrites the config with the mods in workshop collection. ex, $refill 1332156191", inline=False)
await ctx.send(embed=embed)

@bot.command()
async def list(ctx):
Expand Down Expand Up @@ -234,6 +251,4 @@ async def refill(ctx,arg):
except:
print(f"{Fore.MAGENTA}[Fill] Error filling collection")



bot.run(TOKEN)

0 comments on commit fad1f43

Please sign in to comment.