mirror of
				https://gitlab.com/ddorn/tfjm-discord-bot.git
				synced 2025-10-31 06:59:52 +01:00 
			
		
		
		
	✨ Fan club command
This commit is contained in:
		| @@ -1,3 +1,4 @@ | |||||||
|  | import asyncio | ||||||
| import datetime | import datetime | ||||||
| import io | import io | ||||||
| import itertools | import itertools | ||||||
| @@ -211,6 +212,22 @@ class MiscCog(Cog, name="Divers"): | |||||||
|  |  | ||||||
|         await msg.edit(content=f"Pong ! Ça a pris {int(1000 * (pong - ping))}ms") |         await msg.edit(content=f"Pong ! Ça a pris {int(1000 * (pong - ping))}ms") | ||||||
|  |  | ||||||
|  |     @command(name="fan", aliases=["join", "adhere"], hidden=True) | ||||||
|  |     async def fan_club_cmd(self, ctx: Context, who: Member): | ||||||
|  |         """Permet de rejoindre le fan-club d'Ananas ou Citron Vert.""" | ||||||
|  |         role_id = FAN_CLUBS.get(who.id, None) | ||||||
|  |         role = get(ctx.guild.roles, id=role_id) | ||||||
|  |  | ||||||
|  |         print(FAN_CLUBS, who.id, role_id, role) | ||||||
|  |         if role is not None: | ||||||
|  |             await ctx.author.add_roles(role) | ||||||
|  |             await ctx.send(f"Bienvenue au {role.mention} !! :tada:") | ||||||
|  |         else: | ||||||
|  |             await ctx.send( | ||||||
|  |                 f"{who.mention} n'a pas encore de fan club. Peut-être qu'un jour " | ||||||
|  |                 f"iel sera un membre influent du CNO ?" | ||||||
|  |             ) | ||||||
|  |  | ||||||
|     # ---------------- Jokes ---------------- # |     # ---------------- Jokes ---------------- # | ||||||
|  |  | ||||||
|     def load_jokes(self) -> List[Joke]: |     def load_jokes(self) -> List[Joke]: | ||||||
| @@ -298,7 +315,7 @@ class MiscCog(Cog, name="Divers"): | |||||||
|                 reaction, user = await self.bot.wait_for( |                 reaction, user = await self.bot.wait_for( | ||||||
|                     "reaction_add", check=check, timeout=end - time() |                     "reaction_add", check=check, timeout=end - time() | ||||||
|                 ) |                 ) | ||||||
|             except TimeoutError: |             except asyncio.TimeoutError: | ||||||
|                 return |                 return | ||||||
|  |  | ||||||
|             if user.id == BOT: |             if user.id == BOT: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user