-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjoin.py
More file actions
executable file
·36 lines (29 loc) · 1.06 KB
/
join.py
File metadata and controls
executable file
·36 lines (29 loc) · 1.06 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 os
import time
import discord
from dotenv import load_dotenv
from discord.ext import commands
import re
import asyncio
load_dotenv()
intents = discord.Intents.all()
client = commands.Bot(command_prefix='!', intents=intents)
@client.event
async def on_ready():
print('join started on bot {0.user}'.format(client))
@client.event
async def on_guild_join(guild):
if guild.id == int(os.getenv('main_server')):
return
category = await guild.create_category("Bulk Orders")
channel = await guild.create_text_channel("create-order", category=category)
message = await channel.send("Use this to create an order form for a bulk purchase.\n\nTo create an order react with 📩")
await message.add_reaction("📩")
guilds_file = open("guilds_ext.list", "a")
guilds_file.write(str(str(guild.id) + "\n"))
guilds_file.write(str(str(category.id) + "\n"))
guilds_file.write(str(str(channel.id) + "\n"))
guilds_file.write(str(str(message.id) + "\n"))
guilds_file.close()
client.run(os.getenv('TOKEN'))