Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
289 views
in Technique[技术] by (71.8m points)

Making a verification bot in Discord.py

I am in progress of making a Discord bot. I would like the bot to send a direct message to newly joined members including their username and avatar. Then finding if the account is too new, as an anti raiding system in my Bot.

question from:https://stackoverflow.com/questions/65868003/making-a-verification-bot-in-discord-py

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Your criteria is not possible in Discord. Getting personal data (Users email address) from a Discord user is not possible what so ever. Discord would never let any user have access to private data in their API.

Fortunately, a much easier way of creating this is to check if the account was recently made. Using member.created_at.strftime("%a, %#d %B %Y, %I:%M %p UTC")) will simply get the time and date the joined user created their account at. I'll leave it up to you when you want to set a threshold of how early a user can join.

You can also check when the user joined a server with, also remember to define the member as the Discord user who joined. I am leaving the rest for you to complete but hoping this helps get you farther in your progress. Next time, remember to include your trialed attempt and please don't always rely on the community to give you a whole code of answers.

member.joined_at.strftime("%a, %#d %B %Y, %I:%M %p UTC"))

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...