Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
fxtwitter
Browse files
app.py
CHANGED
@@ -129,6 +129,22 @@ async def on_message(message):
|
|
129 |
|
130 |
user_cooldowns[message.author.id]['timestamp'] = message.created_at
|
131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
await bot.process_commands(message)
|
133 |
|
134 |
except Exception as e:
|
|
|
129 |
|
130 |
user_cooldowns[message.author.id]['timestamp'] = message.created_at
|
131 |
|
132 |
+
|
133 |
+
if message.channel.id == 1359016583590051981: # bot-test for now, switch to official one if it works + give perms to ping the role
|
134 |
+
new_content = message.content.replace("https://x.com", "https://fxtwitter.com").replace("https://twitter.com", "https://fxtwitter.com")
|
135 |
+
|
136 |
+
try:
|
137 |
+
await message.delete()
|
138 |
+
await message.channel.send(f'Hey <@&1359026656114638858> , *yeet** just posted a new banger! 😎 \n{new_content}')
|
139 |
+
except discord.Forbidden:
|
140 |
+
print("Missing permissions to delete or send messages.")
|
141 |
+
except discord.HTTPException as e:
|
142 |
+
print(f"HTTP error occurred: {e}")
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
+
|
147 |
+
|
148 |
await bot.process_commands(message)
|
149 |
|
150 |
except Exception as e:
|