ajout !pingrand
This commit is contained in:
parent
f5839ff6b5
commit
426493cdc5
1 changed files with 16 additions and 2 deletions
18
ecoplus.py
18
ecoplus.py
|
@ -1,4 +1,5 @@
|
||||||
import sys
|
import sys
|
||||||
|
import random
|
||||||
import discord
|
import discord
|
||||||
|
|
||||||
import db
|
import db
|
||||||
|
@ -15,12 +16,21 @@ db.credentials = secrets[1]
|
||||||
|
|
||||||
intents = discord.Intents.default()
|
intents = discord.Intents.default()
|
||||||
intents.message_content = True
|
intents.message_content = True
|
||||||
|
intents.members = True
|
||||||
|
|
||||||
client = discord.Client(intents=intents)
|
client = discord.Client(intents=intents, activity=discord.Game(name='En train de niquer des mères'))
|
||||||
|
|
||||||
|
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
|
||||||
|
guild = client.get_guild(gid)
|
||||||
|
|
||||||
|
async for member in guild.fetch_members(limit=150):
|
||||||
|
gmembers.append(member)
|
||||||
|
print(member)
|
||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
async def on_message(message):
|
async def on_message(message):
|
||||||
|
@ -33,6 +43,10 @@ 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>")
|
await message.channel.send("<@499533339468759052>")
|
||||||
|
if content == "!pingrand":
|
||||||
|
choice = random.choice(gmembers)
|
||||||
|
await message.channel.send("<@"+str(choice.id)+">")
|
||||||
|
|
||||||
|
|
||||||
client.run(token)
|
client.run(token)
|
||||||
|
|
Loading…
Add table
Reference in a new issue