mirror of
https://gitlab.com/ddorn/tfjm-discord-bot.git
synced 2025-12-14 20:45:15 +01:00
✨ add teams list
This commit is contained in:
16
src/utils.py
16
src/utils.py
@@ -1,4 +1,20 @@
|
||||
from discord import Message
|
||||
from discord.ext.commands import Context, Bot
|
||||
|
||||
|
||||
def has_role(member, role: str):
|
||||
"""Return whether the member has a role with this name."""
|
||||
|
||||
return any(r.name == role for r in member.roles)
|
||||
|
||||
|
||||
async def send_and_bin(bot: Bot, ctx: Context, msg=None, *, embed=None):
|
||||
"""Send a message and wait 5min for the author to delete it."""
|
||||
|
||||
message: Message = await ctx.send(msg, embed=embed)
|
||||
|
||||
await msg
|
||||
|
||||
|
||||
def setup(bot):
|
||||
bot.send_and_bin = send_and_bin
|
||||
|
||||
Reference in New Issue
Block a user