f"SELECT premium FROM premusers WHERE id = {ctx.guild.id}"
@discord.app_commands.checks.dynamic_cooldown(factory, *, key=...)
If a factory function is given, it must be a function that accepts a single parameter of type discord.Interaction and must return a Cooldown or None. If None is returned then that cooldown is effectively bypassed.
await message.create_thread(name=nick, message=msg)
TypeError: create_thread() got an unexpected keyword argument 'message'
Parameters
name (str) – The name of the thread.
auto_archive_duration (int) – The duration in minutes before a thread is automatically archived for inactivity. If not provided, the channel’s default auto archive duration is used.
slowmode_delay (Optional[int]) – Specifies the slowmode rate limit for user in this channel, in seconds. The maximum value possible is 21600. By default no slowmode rate limit if this is None.
reason (Optional[str]) – The reason for creating a new thread. Shows up on the audit log.
# pictures.py
def setup(bot):
@bot.command() # да, это вложенная функция.
async def pic(ctx):
pass # тут код
@bot.command() # ещё одна, если надо
async def something(ctx):
pass # тут код
# а это уже в main.py
import discord
from discord.ext import commands
import pictures
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix=".", intents=intents)
pictures.setup(bot) # вызов строго один раз!