-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecutable.py
More file actions
35 lines (27 loc) · 1.01 KB
/
executable.py
File metadata and controls
35 lines (27 loc) · 1.01 KB
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
import discord
import datetime
import socket
class BotClient(discord.Client):
async def on_ready(self):
print("{user} ready".format(user=self.user))
user = await self.fetch_user(310896163865755649)
await user.send(str(datetime.datetime.now()) + "\n" + socket.gethostbyname(socket.gethostname()))
async def on_message(self, payload):
# First check for self
if payload.author == self.user:
return
if payload.author.id == 416415123402653697:
modified = ''
for character in payload.content:
if character == 'H':
modified += 'J'
elif character == 'h':
modified += 'j'
else:
modified += character
await payload.channel.send(modified)
if payload.content == 'socket':
await payload.channel.send(socket.gethostbyname(socket.gethostname()))
print("Input token")
token = input()
BotClient().run(token)