-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.py
More file actions
35 lines (29 loc) · 1.15 KB
/
signup.py
File metadata and controls
35 lines (29 loc) · 1.15 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
#!/bin/python3 -u
import discord
import os
from dotenv import load_dotenv
from discord.ext import commands
load_dotenv()
client = commands.Bot(command_prefix='!')
@client.event
async def on_ready():
print('!signup started on bot {0.user}'.format(client))
@client.event
async def on_message(message):
if message.channel.id == int(os.getenv('channel')):
return
content = message.content
if content.lower() == "!signup":
if message.author == client.user:
if message.channel.id == int(os.getenv('botchan')):
cc_chan = client.get_channel(int(os.getenv('channel')))
await cc_chan.send('*Use this in Discord to ping the mods/admins that you would like to join SOTW')
else:
if message.author.nick:
name = message.author.nick
else:
name = message.author.name
await message.channel.send(name + " would like to sign up for SOTW. Please check if they have passed introductory period and sign them up <@&" + str(os.getenv('leader')) + "> <@&" + str(os.getenv('council')) + ">")
else:
return
client.run(os.getenv('TOKEN'))