-
Notifications
You must be signed in to change notification settings - Fork 0
/
Discobot.py
52 lines (41 loc) · 1.74 KB
/
Discobot.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
42
43
44
45
46
47
48
49
50
51
52
import discord
import os
import time
import asyncio
import requests
from account import User
client = discord.Client()
@client.event
async def on_message(message):
print(message.content) # Now every message sent will be printed to the console
@client.event
async def on_message(message):
if message.content.find("!hello") != -1:
await message.channel.send("Hi") # If the user says !hello we will send back hi
def jls_extract_def():
return
@client.event
async def on_message(message):
username = str(message.author).split('#')[
0] # Get discord user's username without the #
user_message = str(message.content)
channel = str(message.channel.name)
print(f'{username}: {user_message} ({channel})')
# Housekeeping
if message.author == client.user:
return # Don't let the bot log its own messages
# Message awaits
if message.channel.name == 'feed': # random channel name in the discord server I've currently got this set bot set in
if user_message.startswith("!login"):
await message.channel.send("Enter your Username, starting with !Username")
if user_message.startswith("!Username"):
userNameTemp = user_message.replace('!Username', '')
message.author = User(str(userNameTemp), "Hi")
await message.channel.send("Your username is: " + userNameTemp + ", now enter your token starting with !Token")
if user_message.startswith("!Token"):
userTokenTemp = user_message.replace('!token ', '')
User[0].token = str(userTokenTemp)
await message.channel.send("Hi" + User[0])
client.run(discotoken)
# 097a72d9-1321-4048-9f74-b189c2c4ca00
#ODU2MDkwNjM2MDE2NTQ5ODg4.YM7-iQ.Jwo9fjvoB9VmUnBbGbqejbyaBoQ