24 lines
409 B
Python
24 lines
409 B
Python
# bot.py
|
|
import os
|
|
|
|
import discord
|
|
|
|
TOKEN = os.getenv('DISCORD_TOKEN')
|
|
GUILD = os.getenv('DISCORD_GUILD')
|
|
|
|
client = discord.Client()
|
|
|
|
@client.event
|
|
async def on_ready():
|
|
for guild in client.guilds:
|
|
if guild.name == GUILD:
|
|
break
|
|
|
|
print(
|
|
f'{client.user} is connected to the following guild:\n'
|
|
f'{guild.name}(id: {guild.id})'
|
|
)
|
|
|
|
def main():
|
|
client.run(TOKEN)
|