Ajout multiserv + cas !pinguncon
This commit is contained in:
parent
426493cdc5
commit
d030275103
1 changed files with 19 additions and 9 deletions
28
ecoplus.py
28
ecoplus.py
|
@ -20,17 +20,21 @@ intents.members = True
|
||||||
|
|
||||||
client = discord.Client(intents=intents, activity=discord.Game(name='En train de niquer des mères'))
|
client = discord.Client(intents=intents, activity=discord.Game(name='En train de niquer des mères'))
|
||||||
|
|
||||||
gmembers = []
|
guilds = []
|
||||||
|
|
||||||
|
globals()["gmembers"] = {}
|
||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
print(f'We have logged in as {client.user}')
|
print(f'We have logged in as {client.user}')
|
||||||
gid = 750665878072328242
|
async for guild in client.fetch_guilds(limit=150):
|
||||||
guild = client.get_guild(gid)
|
print(str(guild.id)+":")
|
||||||
|
guilds.append(guild)
|
||||||
async for member in guild.fetch_members(limit=150):
|
sid = str(guild.id)
|
||||||
gmembers.append(member)
|
globals()["gmembers"] |= {sid:[]}
|
||||||
print(member)
|
async for member in guild.fetch_members(limit=150):
|
||||||
|
globals()["gmembers"][sid].append(member)
|
||||||
|
print(" "+str(member))
|
||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
async def on_message(message):
|
async def on_message(message):
|
||||||
|
@ -43,9 +47,15 @@ async def on_message(message):
|
||||||
await message.channel.send('henlo')
|
await message.channel.send('henlo')
|
||||||
return
|
return
|
||||||
if content == "!pinguncon":
|
if content == "!pinguncon":
|
||||||
await message.channel.send("<@499533339468759052>")
|
#fcalva's server
|
||||||
|
if message.guild.id == 750665878072328242:
|
||||||
|
await message.channel.send("<@499533339468759052>")
|
||||||
|
elif message.guild.id in [1008485562304450610, 1157767629738618941]:
|
||||||
|
await message.channel.send("<@755081785393676328>")
|
||||||
|
else:
|
||||||
|
await message.channel.send("pas dispo ici")
|
||||||
if content == "!pingrand":
|
if content == "!pingrand":
|
||||||
choice = random.choice(gmembers)
|
choice = random.choice(globals()["gmembers"][str(message.guild.id)])
|
||||||
await message.channel.send("<@"+str(choice.id)+">")
|
await message.channel.send("<@"+str(choice.id)+">")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue