webooookkkks
This commit is contained in:
15
bot.py
15
bot.py
@@ -31,8 +31,19 @@ async def on_message(message):
|
|||||||
message.content,
|
message.content,
|
||||||
flags=re.IGNORECASE
|
flags=re.IGNORECASE
|
||||||
)
|
)
|
||||||
# Send the modified message
|
|
||||||
await message.channel.send(f'{new_content}')
|
# Get or create a webhook for impersonation
|
||||||
|
webhooks = await message.channel.webhooks()
|
||||||
|
webhook = next((w for w in webhooks if w.name == 'FagOSWebhook'), None)
|
||||||
|
if webhook is None:
|
||||||
|
webhook = await message.channel.create_webhook(name='FagOSWebhook')
|
||||||
|
|
||||||
|
# Send the modified message via webhook with original user's username and avatar
|
||||||
|
await webhook.send(
|
||||||
|
content=new_content,
|
||||||
|
username=message.author.display_name,
|
||||||
|
avatar_url=message.author.display_avatar.url
|
||||||
|
)
|
||||||
|
|
||||||
# Allow other commands to process (if any)
|
# Allow other commands to process (if any)
|
||||||
await bot.process_commands(message)
|
await bot.process_commands(message)
|
||||||
|
|||||||
Reference in New Issue
Block a user