-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
34 lines (27 loc) · 878 Bytes
/
bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'''
--------------
FX-TWITTER BOT
--------------
> Made with 💖 in France by EletrixTime
(https://github.com/1scr/fxtwitter.bot)
'''
regex = r'https://(twitter\.com|x\.com)'
import os
from interactions import *
import json
import re
config = json.loads(open("config.json").read())
bot = Client(intents=Intents.DEFAULT)
for i in config["status"]:
print(i)
@listen()
async def on_ready():
print("Bot prêt")
@listen()
async def on_message_create(event):
msg = event.message.content
if msg.startswith("https://twitter.com") or msg.startswith("https://x.com"):
channel = await bot.fetch_channel(event.message.channel.id);await channel.delete_message(event.message.id)
d = re.sub(regex, '', msg)
print(d)
await channel.send(f"{d} \n \n \n > Message Original de <@{event.message.author.id}>")