Adding a feature to automatically timeout users if the selfbot has permission.
The Ideal Solution
Allowing the bot to timeout, and un-timeout users for a designated reason and amount of time.
The Current Solution
async def timeout_user(*, user_id: int, guild_id: int, until): headers = {"Authorization": f"Bot {bot.http.token}"} url = f"https://discord.com/api/v9/guilds/{guild_id}/members/{user_id}" timeout = (datetime.datetime.utcnow() + datetime.timedelta(minutes=until)).isoformat() json = {'communication_disabled_until': timeout} async with bot.session.patch(url, json=json, headers=headers) as session: if session.status in range(200, 299): return True return False
A previous solution of requesting the discord api has been given, however this does not work for selfbots.
Summary
discord.py has bot.timeout(until, reason)
What is the feature request for?
discord.ext.commands
The Problem
Adding a feature to automatically timeout users if the selfbot has permission.
The Ideal Solution
Allowing the bot to timeout, and un-timeout users for a designated reason and amount of time.
The Current Solution
async def timeout_user(*, user_id: int, guild_id: int, until): headers = {"Authorization": f"Bot {bot.http.token}"} url = f"https://discord.com/api/v9/guilds/{guild_id}/members/{user_id}" timeout = (datetime.datetime.utcnow() + datetime.timedelta(minutes=until)).isoformat() json = {'communication_disabled_until': timeout} async with bot.session.patch(url, json=json, headers=headers) as session: if session.status in range(200, 299): return True return False
A previous solution of requesting the discord api has been given, however this does not work for selfbots.Additional Context
No response