Skip to content

絵文字スロットを追加 #5

@sharkbot-neko

Description

@sharkbot-neko

サーバー内にある絵文字でスロットを回せる機能
経済機能に組み込む予定

    @commands.command(name="slot")
    async def slot(self, ctx: commands.Context):
        emojis = ctx.guild.emojis
        if len(emojis) < 3:
            return await ctx.reply(content="少なくても絵文字が3つは必要です。")
        emoji_1 = random.choice(emojis).__str__()
        emoji_2 = random.choice(emojis).__str__()
        emoji_3 = random.choice(emojis).__str__()
        message = "はずれ・・"
        if emoji_1 == emoji_2 and emoji_1 == emoji_3 and emoji_2 == emoji_3:
            message = "あたり!"
        await ctx.reply(embed=discord.Embed(title="スロットを回しました。", color=discord.Color.green(), description=f"{emoji_1} {emoji_2} {emoji_3}")
                        .add_field(name="結果", value=message, inline=False))

コードのメモ

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions