game stuff

This commit is contained in:
NikolajDanger
2021-09-30 14:05:50 +02:00
parent 5330a51fe0
commit cbf2ca765e
12 changed files with 538 additions and 551 deletions

View File

@ -52,26 +52,6 @@ class BlackjackCog(commands.Cog):
"""Enter the game of blackjack with a bet."""
await self.bot.games.blackjack.enter_game(ctx, bet)
@cog_ext.cog_subcommand(**params["blackjack_stand"])
async def blackjack_stand(self, ctx, hand=0):
"""Stand on your hand in blackjack."""
await self.bot.games.blackjack.stand(ctx, hand)
@cog_ext.cog_subcommand(**params["blackjack_hit"])
async def blackjack_hit(self, ctx, hand=0):
"""Hit on your hand in blackjack."""
await self.bot.games.blackjack.hit(ctx, hand)
@cog_ext.cog_subcommand(**params["blackjack_double"])
async def blackjack_double(self, ctx, hand=0):
"""Double in blackjack."""
await self.bot.games.blackjack.double(ctx, hand)
@cog_ext.cog_subcommand(**params["blackjack_split"])
async def blackjack_split(self, ctx, hand=0):
"""Split your hand in blackjack."""
await self.bot.games.blackjack.split(ctx, hand)
@cog_ext.cog_subcommand(**params["blackjack_hilo"])
async def blackjack_hilo(self, ctx):
"""Get the hilo value for the deck in blackjack."""

View File

@ -1,6 +1,7 @@
"""Contains the MiscCog, which deals with miscellaneous commands."""
from discord.ext import commands # Has the cog class
from discord_slash import cog_ext # Used for slash commands
from discord_slash.context import SlashContext
from gwendolyn.utils import get_params # pylint: disable=import-error
@ -19,77 +20,77 @@ class MiscCog(commands.Cog):
self.nerd_shit = bot.other.nerd_shit
@cog_ext.cog_slash(**params["ping"])
async def ping(self, ctx):
async def ping(self, ctx: SlashContext):
"""Send the bot's latency."""
await ctx.send(f"Pong!\nLatency is {round(self.bot.latency * 1000)}ms")
@cog_ext.cog_slash(**params["stop"])
async def stop(self, ctx):
async def stop(self, ctx: SlashContext):
"""Stop the bot."""
await self.bot.stop(ctx)
@cog_ext.cog_slash(**params["help"])
async def help_command(self, ctx, command=""):
async def help_command(self, ctx: SlashContext, command=""):
"""Get help for commands."""
await self.bot.other.helpFunc(ctx, command)
@cog_ext.cog_slash(**params["thank"])
async def thank(self, ctx):
async def thank(self, ctx: SlashContext):
"""Thank the bot."""
await ctx.send("You're welcome :blush:")
@cog_ext.cog_slash(**params["hello"])
async def hello(self, ctx):
async def hello(self, ctx: SlashContext):
"""Greet the bot."""
await self.bot.other.helloFunc(ctx)
@cog_ext.cog_slash(**params["roll"])
async def roll(self, ctx, dice="1d20"):
async def roll(self, ctx: SlashContext, dice="1d20"):
"""Roll dice."""
await self.bot.other.rollDice(ctx, dice)
@cog_ext.cog_slash(**params["image"])
async def image(self, ctx):
async def image(self, ctx: SlashContext):
"""Get a random image from Bing."""
await self.bot.other.imageFunc(ctx)
@cog_ext.cog_slash(**params["movie"])
async def movie(self, ctx):
async def movie(self, ctx: SlashContext):
"""Get a random movie from the Plex server."""
await self.bot.other.movieFunc(ctx)
@cog_ext.cog_slash(**params["name"])
async def name(self, ctx):
async def name(self, ctx: SlashContext):
"""Generate a random name."""
await self.generators.nameGen(ctx)
@cog_ext.cog_slash(**params["tavern"])
async def tavern(self, ctx):
async def tavern(self, ctx: SlashContext):
"""Generate a random tavern name."""
await self.generators.tavernGen(ctx)
@cog_ext.cog_slash(**params["wiki"])
async def wiki(self, ctx, wiki_page=""):
async def wiki(self, ctx: SlashContext, wiki_page=""):
"""Get a page on a fandom wiki."""
await self.bot.other.findWikiPage(ctx, wiki_page)
@cog_ext.cog_slash(**params["add_movie"])
async def add_movie(self, ctx, movie):
async def add_movie(self, ctx: SlashContext, movie):
"""Search for a movie and add it to the Plex server."""
await self.plex.request_movie(ctx, movie)
@cog_ext.cog_slash(**params["add_show"])
async def add_show(self, ctx, show):
async def add_show(self, ctx: SlashContext, show):
"""Search for a show and add it to the Plex server."""
await self.plex.request_show(ctx, show)
@cog_ext.cog_slash(**params["downloading"])
async def downloading(self, ctx, parameters="-d"):
async def downloading(self, ctx: SlashContext, parameters="-d"):
"""Get the current downloading torrents."""
await self.plex.downloading(ctx, parameters)
@cog_ext.cog_slash(**params["wolf"])
async def wolf(self, ctx, query):
async def wolf(self, ctx: SlashContext, query):
"""Perform a search on Wolfram Alpha."""
await self.nerd_shit.wolfSearch(ctx, query)