-
Notifications
You must be signed in to change notification settings - Fork 3
/
myutils.py
108 lines (74 loc) · 3.79 KB
/
myutils.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
97
98
99
100
101
102
103
104
105
106
107
108
import discord
class MyUtils:
def __init__(self, guild):
self.guild = guild
def getStudentRole(self):
return discord.utils.get(self.guild.roles, name="Student")
def getFuturTCRole(self):
return discord.utils.get(self.guild.roles, name="Futur TC")
def get3TCRole(self):
return discord.utils.get(self.guild.roles, name="3 TC")
def get4TCRole(self):
return discord.utils.get(self.guild.roles, name="4 TC")
def get5TCRole(self):
return discord.utils.get(self.guild.roles, name="5 TC")
def getTCARole(self):
return discord.utils.get(self.guild.roles, name="TCA")
def getProfRole(self):
return discord.utils.get(self.guild.roles, name="prof")
def getDiplomesRole(self):
return discord.utils.get(self.guild.roles, name="Diplômés")
def getG4Role(self):
return discord.utils.get(self.guild.roles, name="G4")
def getASTUSRole(self):
return discord.utils.get(self.guild.roles, name="ASTUS")
def getTeamEventRole(self):
return discord.utils.get(self.guild.roles, name="Team Event")
def getRespTeamEventRole(self):
return discord.utils.get(self.guild.roles, name="Resp Team Event")
def getTeamEntrepriseRole(self):
return discord.utils.get(self.guild.roles, name="Team Entreprise")
def getRespTeamEntrepriseRole(self):
return discord.utils.get(self.guild.roles, name="Resp Team Entreprise")
def getRespSiteRole(self):
return discord.utils.get(self.guild.roles, name="Resp SI")
def getAncienRespSiteRole(self):
return discord.utils.get(self.guild.roles, name="Ancien Resp SI")
def getRespCommRole(self):
return discord.utils.get(self.guild.roles, name="Resp Comm")
def getEntrepriseRole(self):
return discord.utils.get(self.guild.roles, name="Entreprise")
def getAdminRole(self):
return discord.utils.get(self.guild.roles, name="Admin")
def getFuturAstusRole(self):
return discord.utils.get(self.guild.roles, name="Futur ASTUS ?")
def getOrgaSoireeRole(self):
return discord.utils.get(self.guild.roles, name="Orga soirée")
def getG4TxtChannel(self):
return discord.utils.get(self.guild.channels, id=726554977753104464)
def getG4VocalChannel(self):
return discord.utils.get(self.guild.channels, id=726555448739758151)
def getPassationTxtChannel(self):
return discord.utils.get(self.guild.channels, id=771105591941922841)
def getPassationVocalChannel(self):
return discord.utils.get(self.guild.channels, id=771104822564487168)
def getVendrediChillCategory(self):
return discord.utils.get(self.guild.categories, name="🎉Vendredi Chill🎉")
def getPotTresConfineCategory(self):
return discord.utils.get(self.guild.categories, name="Pot Très Confiné")
def getLanOneCategory(self, name):
return discord.utils.get(self.guild.categories, name=name)
async def newAstus(self, members, *roles):
for memberStr in members:
memberID = memberStr[2:-1] if memberStr[2:-1][0] != "!" else memberStr[2:-1][1:]
member = self.guild.get_member(user_id=int(memberID))
for role in roles:
await member.add_roles(role)
def G4check(self, ctx):
return self.getG4Role() in ctx.message.author.roles
def OrgaSoireeCheck(self, ctx):
return self.getOrgaSoireeRole() in ctx.message.author.roles
async def setAdminRole(self, memberStr):
memberID = memberStr[2:-1] if memberStr[2:-1][0] != "!" else memberStr[2:-1][1:]
member = self.guild.get_member(user_id=int(memberID))
await member.add_roles(self.getAdminRole())