33Description:
44This is a template to create your own discord bot in python.
55
6- Version: 5.1
6+ Version: 5.2
77"""
88
99import random
1313from discord import app_commands
1414from discord .ext import commands
1515from discord .ext .commands import Context
16-
1716from helpers import checks
1817
1918
@@ -66,7 +65,10 @@ async def callback(self, interaction: discord.Interaction):
6665 bot_choice_index = choices [bot_choice ]
6766
6867 result_embed = discord .Embed (color = 0x9C84EF )
69- result_embed .set_author (name = interaction .user .name , icon_url = interaction .user .avatar .url )
68+ result_embed .set_author (
69+ name = interaction .user .name ,
70+ icon_url = interaction .user .avatar .url
71+ )
7072
7173 if user_choice_index == bot_choice_index :
7274 result_embed .description = f"**That's a draw!**\n You've chosen { user_choice } and I've chosen { bot_choice } ."
@@ -104,7 +106,7 @@ def __init__(self, bot):
104106 async def randomfact (self , context : Context ) -> None :
105107 """
106108 Get a random fact.
107-
109+
108110 :param context: The hybrid command context.
109111 """
110112 # This will prevent your bot from stopping everything when doing a web request - see: https://discordpy.readthedocs.io/en/stable/faq.html#how-do-i-make-a-web-request
@@ -132,7 +134,7 @@ async def randomfact(self, context: Context) -> None:
132134 async def coinflip (self , context : Context ) -> None :
133135 """
134136 Make a coin flip, but give your bet before.
135-
137+
136138 :param context: The hybrid command context.
137139 """
138140 buttons = Choice ()
@@ -143,7 +145,6 @@ async def coinflip(self, context: Context) -> None:
143145 message = await context .send (embed = embed , view = buttons )
144146 await buttons .wait () # We wait for the user to click a button.
145147 result = random .choice (["heads" , "tails" ])
146- print (buttons .value )
147148 if buttons .value == result :
148149 embed = discord .Embed (
149150 description = f"Correct! You guessed `{ buttons .value } ` and I flipped the coin to `{ result } `." ,
@@ -164,7 +165,7 @@ async def coinflip(self, context: Context) -> None:
164165 async def rock_paper_scissors (self , context : Context ) -> None :
165166 """
166167 Play the rock paper scissors game against the bot.
167-
168+
168169 :param context: The hybrid command context.
169170 """
170171 view = RockPaperScissorsView ()
0 commit comments