-
Notifications
You must be signed in to change notification settings - Fork 8
/
discord_bots.py
30 lines (25 loc) · 977 Bytes
/
discord_bots.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
import discord
from lorabot import LoraBot
client = discord.Client()
lora_bot = LoraBot()
@client.event
async def on_message(message):
if message.author == client.user:
return
else:
lora_bot.user(message.author, "MyAnalyticBot")
if message.content.startswith("analytics"):
# enter keyword and password, divide them by space
text = message.content.split(' ')
if lora_bot.check_password(text[1]):
photo, info = lora_bot.analyze_new_user('MyAnalyticBot')
await message.channel.send(info)
await message.channel.send(file=discord.File(photo))
elif message.content.startswith('Hi!'):
lora_bot.message(message.content, 'text', message.author, "MyAnalyticBot")
await message.channel.send('Hello!')
else:
lora_bot.message(message.content, 'text', message.author, "MyAnalyticBot")
await message.channel.send('!?')
token = ''
client.run(token)