# ╔══════════════════════════════════════════════════════════════════╗ # ║ ║ # ║ +-+-+-+-+-+-+-+-+ ║ # ║ |H|e|x|a|H|o|s|t| ║ # ║ +-+-+-+-+-+-+-+-+ ║ # ║ ║ # ║ © 2026 HexaHost — All Rights Reserved ║ # ║ ║ # ║ discord ── https://discord.gg/hexahost ║ # ║ github ── https://github.com/theoneandonlymace ║ # ║ ║ # ╚══════════════════════════════════════════════════════════════════╝ import discord from discord.ext import commands import os from core import Cog, Axiom, Context import games as games from utils.Tools import * from utils.cv2 import CV2 from games import button_games as btn import random import asyncio class Games(Cog): """Axiom Games""" def __init__(self, client: Axiom): self.client = client @commands.hybrid_group( name="game", description="Play mini-games with friends or the bot.", fallback="help", invoke_without_command=True, ) @blacklist_check() @ignore_check() @commands.cooldown(1, 3, commands.BucketType.user) @commands.guild_only() async def game(self, ctx: Context): """Games root — use `/game ` or `>game `.""" if ctx.subcommand_passed is None: await ctx.send_help(ctx.command) ctx.command.reset_cooldown(ctx) @game.command(name="chess", help="Play Chess with a user.", usage="game chess ") @blacklist_check() @ignore_check() @commands.cooldown(1, 3, commands.BucketType.user) @commands.max_concurrency(5, per=commands.BucketType.default, wait=False) @commands.guild_only() async def _chess(self, ctx: Context, player: discord.Member): if player == ctx.author: await ctx.send(view=CV2("❌ Error", "You Cannot play game with yourself!")) elif player.bot: await ctx.send(view=CV2("❌ Error", "You cannot play with bots!")) else: game = btn.BetaChess(white=ctx.author, black=player) await game.start(ctx) @game.command(name="rps", help="Play Rock Paper Scissor with bot/user.", aliases=["rockpaperscissors"], usage="game rps [user]") @blacklist_check() @ignore_check() @commands.cooldown(1, 3, commands.BucketType.user) @commands.max_concurrency(5, per=commands.BucketType.default, wait=False) @commands.guild_only() async def _rps(self, ctx: Context, player: discord.Member = None): game = btn.BetaRockPaperScissors(player) await game.start(ctx, timeout=120) @game.command(name="tictactoe", help="play tic-tac-toe game with a user.", aliases=["ttt", "tic-tac-toe"], usage="game tictactoe ") @blacklist_check() @ignore_check() @commands.cooldown(1, 3, commands.BucketType.user) @commands.max_concurrency(5, per=commands.BucketType.user, wait=False) @commands.guild_only() async def _ttt(self, ctx: Context, player: discord.Member): if player == ctx.author: await ctx.send(view=CV2("❌ Error", "You cannot play game with yourself!")) elif player.bot: await ctx.send(view=CV2("❌ Error", "You cannot play with bots!")) else: game = btn.BetaTictactoe(cross=ctx.author, circle=player) await game.start(ctx, timeout=30) @game.command(name="wordle", help="Wordle Game | Play with bot.", usage="game wordle") @blacklist_check() @ignore_check() @commands.cooldown(1, 3, commands.BucketType.user) @commands.max_concurrency(3, per=commands.BucketType.default, wait=False) @commands.guild_only() async def _wordle(self, ctx: Context): game = games.Wordle() await game.start(ctx, timeout=120) @game.command(name="2048", help="Play 2048 game with bot.", aliases=["twenty48"], usage="game 2048") @blacklist_check() @ignore_check() @commands.cooldown(1, 3, commands.BucketType.user) @commands.max_concurrency(3, per=commands.BucketType.default, wait=False) @commands.guild_only() async def _2048(self, ctx: Context): game = btn.BetaTwenty48() await game.start(ctx, win_at=2048) @game.command(name="memory", help="How strong is your memory?", aliases=["memory-game"], usage="game memory") @blacklist_check() @ignore_check() @commands.cooldown(1, 3, commands.BucketType.user) @commands.max_concurrency(3, per=commands.BucketType.default, wait=False) @commands.guild_only() async def _memory(self, ctx: Context): game = btn.MemoryGame() await game.start(ctx) @game.command(name="slider", help="slide numbers with bot", aliases=["number-slider"], usage="game slider") @blacklist_check() @ignore_check() @commands.cooldown(1, 3, commands.BucketType.user) @commands.max_concurrency(3, per=commands.BucketType.default, wait=False) @commands.guild_only() async def _number_slider(self, ctx: Context): game = btn.NumberSlider() await game.start(ctx) @game.command(name="battleship", help="Play battleship game with your friend.", aliases=["battle-ship"], usage="game battleship ") @blacklist_check() @ignore_check() @commands.cooldown(1, 3, commands.BucketType.user) @commands.max_concurrency(3, per=commands.BucketType.default, wait=False) @commands.guild_only() async def _battle(self, ctx: Context, player: discord.Member): game = btn.BetaBattleShip(player1=ctx.author, player2=player) await game.start(ctx) @commands.group(name="country-guesser", help="Guess name of the country by flag.", aliases=["guess", "guesser", "countryguesser"], usage="country-guesser") @commands.guild_only() async def _country_guesser(self, ctx: Context): if ctx.invoked_subcommand is None: await ctx.send_help("country-guesser") @_country_guesser.command(name="start", help="Starts the country guesser game. It's a 100 Seconds Game so suggested to play in a SPECIFIC CHANNEL.") async def _start_country_guesser(self, ctx: Context): game = games.CountryGuesser(is_flags=True, hints=2) await game.start(ctx) """@_country_guesser.command(name="end", help="Ends the country guesser game.") async def _end_country_guesser(self, ctx: Context): await self.country_guesser_game.end_game_manually(ctx)""" @game.command(name="connectfour", help="Play Connect Four game with user.", aliases=["c4", "connect-four", "connect4"], usage="game connectfour ") @blacklist_check() @ignore_check() @commands.cooldown(1, 3, commands.BucketType.user) @commands.max_concurrency(1, per=commands.BucketType.user, wait=False) @commands.guild_only() async def _connectfour(self, ctx: Context, player: discord.Member): if player == ctx.author: await ctx.send(view=CV2("❌ Error", "You cannot play against yourself!")) elif player.bot: await ctx.send(view=CV2("❌ Error", "You cannot play with bots!")) else: game = games.ConnectFour(red=ctx.author, blue=player) await game.start(ctx, timeout=300) @game.command(name="lightsout", help="Play Lights Show game with bot.", aliases=["lights-out"], usage="game lightsout") @blacklist_check() @ignore_check() @commands.cooldown(1, 3, commands.BucketType.user) @commands.max_concurrency(3, per=commands.BucketType.default, wait=False) @commands.guild_only() async def _lights_show(self, ctx: Context): game = btn.LightsOut() await game.start(ctx)