mirror of
https://github.com/dizedev/Main-tech.git
synced 2026-09-17 05:58:49 +00:00
cool example in files cogs/coins.py
This commit is contained in:
+5
-5
@@ -1,6 +1,6 @@
|
||||
import asyncio
|
||||
import random
|
||||
|
||||
import disnake
|
||||
from disnake.ext import commands
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ class Coins(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
@commands.slash_command(name="супер", description='Команда, которая возвращает орла или решку.')
|
||||
async def coins(self, ctx):
|
||||
@commands.slash_command(name="монетка", description='Команда, которая возвращает орла или решку.')
|
||||
async def coins(self, ctx: disnake.ApplicationCommandInteraction):
|
||||
coin = ["Орел", "Решка"]
|
||||
result = random.choice(coin)
|
||||
|
||||
info = await ctx.send(f"Орел или решка? Угадайте! Результат будет через 3 секунды...")
|
||||
await ctx.send(f"Орел или решка? Угадайте! Результат будет через 3 секунды...")
|
||||
await asyncio.sleep(3)
|
||||
await ctx.send(f"Результат: {result}!")
|
||||
await ctx.edit_original_response(f"Результат: {result}!")
|
||||
|
||||
|
||||
def setup(bot):
|
||||
|
||||
Reference in New Issue
Block a user