Initial commit
This commit is contained in:
14
bot/channels.py
Normal file
14
bot/channels.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import logging
|
||||
from typing import List
|
||||
|
||||
import discord
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def get_scannable_channels(client: discord.Client, guild_id: int) -> List[discord.TextChannel]:
|
||||
guild = client.get_guild(guild_id)
|
||||
if guild is None:
|
||||
log.warning("Guild %s not found in local cache, skipping", guild_id)
|
||||
return []
|
||||
return list(guild.text_channels)
|
||||
Reference in New Issue
Block a user