-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
32 lines (24 loc) · 994 Bytes
/
bot.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
import discord
import os
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('GUILD_ID')
client = discord.Client()
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
# guild = discord.utils.get(client.guilds, name=GUILD)
# print(
# f'{client.user} is connected to the following guild:\n'
# f'{guild.name}(id: {guild.id})\n'
# )
await client.change_presence(status=discord.Status.online)
@client.event
async def on_message(message: discord.Message):
channel = client.get_channel(702302895353233439)
if message.author == client.user:
return
if message.content.contains("https://discord.gg/"):
await message.channel.send(f'{message.author.mention}, we do not allow promotions of any kind, whether it '
f'be self promotions or discord server links. Please see {channel.mention} for '
f'more details')
client.run(TOKEN)