tfjm-discord-bot/src/utils.py

24 lines
469 B
Python
Raw Normal View History

2020-04-30 15:26:33 +00:00
import asyncio
from typing import Sequence
import psutil
2020-04-30 15:26:33 +00:00
from discord import Message, Member, User, Reaction
2020-04-29 16:43:07 +00:00
from discord.ext.commands import Context, Bot
2020-04-30 15:26:33 +00:00
from discord.utils import get
from src.constants import Emoji
2020-04-29 16:43:07 +00:00
2020-04-29 14:27:40 +00: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 16:43:07 +00:00
2020-04-30 15:26:33 +00:00
def start_time(self):
return psutil.Process().create_time()
2020-04-30 15:26:33 +00:00
def setup(bot: Bot):
pass