<filename>slash6.py
import discord
from discord.ext import commands
from discord_slash import SlashContext, cog_ext
from discord_slash.utils.manage_commands import create_choice, create_option
import secrets
from replit import db
import os
import random


class SlashSix(commands.Cog):
    def __init__(self, client):
        self.client = client

    @cog_ext.cog_slash(name="eightball", description='The Magic 8 Ball answers any question!', options=[create_option(
        name='question',
        description='Ask a question!',
        required=True,
        option_type=3
    )
    ]
                       )
    async def eightball(self, ctx: SlashContext, *, question):
        answers = ['Surely, yes.',
                   'Without a doubt.',
                   'Yes.',
                   "Outlook looking good.",
                   'Very likely.',
                   'I guess, yeah.',
                   'It is decidedly so.',
                   'Signs point to yes.',
                   'You may rely on it.',
                   'As I see it, yes.',
                   "Uhh.... try again maybe?",
                   'Concentrate and ask again.',
                   'I will tell you some other time.',
                   'Ask again later.',
                   'Cannot predict now.',
                   'Outlook not looking so hot.',
                   'My sources say no.',
                   'Very doubtful.',
                   "I wouldn't count on it.",
                   'Nope.']

        embed = discord.Embed(color=discord.Color.dark_purple())
        embed.add_field(name=f"{question}?", value=f'**:8ball:{(secrets.choice(answers))}**', inline=False)
        await ctx.send(embed=embed)

    # Work command
    @cog_ext.cog_slash(name="work", description='Work to earn money from $1-$12! (Cooldown of 4 seconds.)')
    @commands.cooldown(1, 4, commands.BucketType.user)
    async def work(self, ctx):
        cash = random.randint(1, 12)
        embed = discord.Embed(color=discord.Color.green())
        embed.add_field(name='You earned:', value=f'**${cash}**', inline=False)
        await ctx.send(embed=embed)
        try:
            accBalance = db[str(ctx.author.id)]
        except:
            accBalance = 0

        db[str(ctx.author.id)] = accBalance + cash

    # Balance command
    @cog_ext.cog_slash(name="balance", description='View your balance.')
    async def balance(self, ctx):
        try:
            accBalance = db[str(ctx.author.id)]
        except:
            accBalance = 0
        embed = discord.Embed(color=discord.Color.green())
        embed.add_field(name='Your account balance is:', value=f'**${accBalance}**', inline=False)
        await ctx.send(embed=embed)


def setup(client):
    client.add_cog(SlashSix(client))

<filename>slash6.py
import discord
from discord.ext import commands
from discord_slash import SlashContext, cog_ext
from discord_slash.utils.manage_commands import create_choice, create_option
import secrets
from replit import db
import os
import random


class SlashSix(commands.Cog):
    def __init__(self, client):
        self.client = client

    @cog_ext.cog_slash(name="eightball", description='The Magic 8 Ball answers any question!', options=[create_option(
        name='question',
        description='Ask a question!',
        required=True,
        option_type=3
    )
    ]
                       )
    async def eightball(self, ctx: SlashContext, *, question):
        answers = ['Surely, yes.',
                   'Without a doubt.',
                   'Yes.',
                   "Outlook looking good.",
                   'Very likely.',
                   'I guess, yeah.',
                   'It is decidedly so.',
                   'Signs point to yes.',
                   'You may rely on it.',
                   'As I see it, yes.',
                   "Uhh.... try again maybe?",
                   'Concentrate and ask again.',
                   'I will tell you some other time.',
                   'Ask again later.',
                   'Cannot predict now.',
                   'Outlook not looking so hot.',
                   'My sources say no.',
                   'Very doubtful.',
                   "I wouldn't count on it.",
                   'Nope.']

        embed = discord.Embed(color=discord.Color.dark_purple())
        embed.add_field(name=f"{question}?", value=f'**:8ball:{(secrets.choice(answers))}**', inline=False)
        await ctx.send(embed=embed)

    # Work command
    @cog_ext.cog_slash(name="work", description='Work to earn money from $1-$12! (Cooldown of 4 seconds.)')
    @commands.cooldown(1, 4, commands.BucketType.user)
    async def work(self, ctx):
        cash = random.randint(1, 12)
        embed = discord.Embed(color=discord.Color.green())
        embed.add_field(name='You earned:', value=f'**${cash}**', inline=False)
        await ctx.send(embed=embed)
        try:
            accBalance = db[str(ctx.author.id)]
        except:
            accBalance = 0

        db[str(ctx.author.id)] = accBalance + cash

    # Balance command
    @cog_ext.cog_slash(name="balance", description='View your balance.')
    async def balance(self, ctx):
        try:
            accBalance = db[str(ctx.author.id)]
        except:
            accBalance = 0
        embed = discord.Embed(color=discord.Color.green())
        embed.add_field(name='Your account balance is:', value=f'**${accBalance}**', inline=False)
        await ctx.send(embed=embed)


def setup(client):
    client.add_cog(SlashSix(client))

# Work command # Balance command