-
Notifications
You must be signed in to change notification settings - Fork 0
/
authenthicate.py
96 lines (80 loc) · 3.12 KB
/
authenthicate.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import discord
def botstatus():
"""
Update Idea: Implement with DB
"""
with open("status.txt") as f:
return eval(f.readline())
def tooglebotstatus():
"""
Update Idea: Implement with DB
"""
if botstatus():
with open("status.txt", 'w') as f:
f.writelines("False")
else:
with open("status.txt", 'w') as f:
f.writelines("True")
def ifAdmin(ctx):
"""
Update Idea: Implement with DB
"""
if str(ctx.author) == "admin_username":
return True
return False
def ifServer1(ctx):
if int(ctx.guild.id) == int("Server 1 ID"):
return True
return False
def ifServer2(ctx):
if int(ctx.guild.id) == int("Server 2 ID"):
return True
return False
async def verifymember(ctx, user):
role = ctx.guild.get_role("Role ID")
rrole = ctx.guild.get_role("Removing Role ID")
await user.add_roles(role)
await user.remove_roles(rrole)
overwrites = {
ctx.guild.default_role:
discord.PermissionOverwrite(read_messages=False,
send_messages=False,
connect=False,
speak=False)
}
category = await ctx.guild.create_category(str(user.name),
overwrites=overwrites)
channel = await ctx.guild.create_text_channel('text',
overwrites=overwrites,
category=category)
voice = await ctx.guild.create_voice_channel(
'voice', overwrites=overwrites, category=category)
await category.set_permissions(user,
read_messages=True,
send_messages=True,
connect=True,
speak=True)
await channel.send(f"{user.name} is verified!.")
async def newinServer1(member):
category = discord.utils.get(member.guild.categories,
id="Server 1's category ID")
channel = await member.guild.create_text_channel(
f'temp-channel-{member.name}', category=category)
await channel.set_permissions(member,
read_messages=True,
send_messages=True,
read_message_history=True)
await channel.send(
f'Welcome, {member.mention}! Wait for roles. Type **!help** for bot commands.'
)
async def newinServer2(member):
category = discord.utils.get(member.guild.categories,
id="Server 2's category ID")
channel = await member.guild.create_text_channel(f'intruder-{member.name}',
category=category)
await channel.set_permissions(member,
read_messages=True,
send_messages=True,
read_message_history=True)
await channel.send(f'Who are you?! What are you doing here!!!')
return channel.id