Started work on converting all commands to slash-commands

This commit is contained in:
NikolajDanger
2021-03-29 00:55:31 +02:00
parent e6e6b9b9b9
commit 232f97d0c8
11 changed files with 363 additions and 179 deletions

View File

@ -1,5 +1,6 @@
import discord, string
from discord.ext import commands
from discord_slash import cog_ext
from funcs import cap
@ -10,16 +11,16 @@ class SwCog(commands.Cog):
self.client = client
# Rolls star wars dice
@commands.command()
async def swroll(self, ctx, *, content = ""):
command = cap(content)
@cog_ext.cog_slash()
async def swroll(self, ctx, dice = ""):
command = cap(dice)
newMessage = self.client.swroll.parseRoll("#"+str(ctx.message.author.id),command)
messageList = newMessage.split("\n")
for messageItem in messageList:
await ctx.send(messageItem)
# Controls destiny points
@commands.command()
@cog_ext.cog_slash()
async def swd(self, ctx, *, content):
newMessage = self.client.swdestiny.parseDestiny("#"+str(ctx.message.author.id),content)
messageList = newMessage.split("\n")
@ -27,7 +28,7 @@ class SwCog(commands.Cog):
await ctx.send(messageItem)
# Rolls for critical injuries
@commands.command()
@cog_ext.cog_slash()
async def swcrit(self, ctx, arg : int = 0):
newMessage = self.client.swroll.critRoll(int(arg))
@ -37,7 +38,7 @@ class SwCog(commands.Cog):
# Accesses and changes character sheet data with the parseChar function
# from funcs/swfuncs/swchar.py
@commands.command(aliases=["sw"])
@cog_ext.cog_slash()
async def swchar(self, ctx, *, content = ""):
command = string.capwords(content.replace("+","+ ").replace("-","- ").replace(",",", "))
title, desc = self.client.swchar.parseChar("#"+str(ctx.message.author.id),command)