-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
49 lines (32 loc) · 1.11 KB
/
main.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
import os
import discord
from dog import get_random_dog
from help import get_help
from random_functions import get_random_number
from team_generator import create_teams
from weather import get_weather
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.environ.get("TOKEN")
print(TOKEN)
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print(f'We have logged in as {client.user}')
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('!help'):
await message.channel.send(get_help(message))
if message.content.startswith('!random'):
await message.channel.send(get_random_number(message))
if message.content.startswith('!dog'):
await message.channel.send(embed=get_random_dog())
if message.content.startswith("!weather"):
await message.channel.send(get_weather(message))
if message.content.startswith("!teams"):
await message.channel.send(create_teams(message))
client.run(TOKEN)