1
0
mirror of https://gitlab.com/ddorn/tfjm-discord-bot.git synced 2025-02-06 14:53:05 +00:00

26 lines
571 B
Python
Raw Normal View History

import psutil
2020-04-29 18:43:07 +02:00
from discord import Message
from discord.ext.commands import Context, Bot
2020-04-29 16:27:40 +02:00
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)
2020-04-29 18:43:07 +02:00
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 start_time():
return psutil.Process().create_time()
2020-04-29 18:43:07 +02:00
def setup(bot):
bot.send_and_bin = send_and_bin