Vico
Vico
DIAdiscord.js - Imagine an app
Created by Vico on 9/20/2023 in #djs-questions
Get member "in-server" nickname
How can i properly get the username of a member in a server? I tried to use <Message>.author.displayName under messageCreate callback but it returned the "global" username (in case of a specific member that didn't migrated to the new format yet, the user#0000 format). How can i safely fetch the user that was set to be use inside the guild?
7 replies
DIAdiscord.js - Imagine an app
Created by Vico on 8/13/2023 in #djs-questions
Check if user that sent a message have permission
How can i check if the bot have a specific permission on the server? I was using if (msg.member.permissions.has("USE_APPLICATION_COMMANDS")) but its giving me Cannot read properties of null (reading 'permissions')
50 replies
DIAdiscord.js - Imagine an app
Created by Vico on 3/5/2023 in #djs-questions
Event to detect whenever the member accept (or not) the rules on Rules Screening screen
I want to show a modal to user immediately after he accept the rules (to try to "restore" the unimplemented feature of input fields on the rule screening menu), but cant find any documentation (for Discord.js v14) about how to detect that interaction. Is this even possible?
8 replies
DIAdiscord.js - Imagine an app
Created by Vico on 3/2/2023 in #djs-questions
Retrieve the last message (reply to a specific user) the bot sent
Hello! I'm coding a personal ChatGPT bot for my guild, and one of the payload fields to sent to openai should contain the last message the bot sent to the user for contextual purposes. The problem is: i'm trying several methods to fetch the last message (specficially the last reply to the user that invoked the bot, if exists) the bot sent in the server (any channel) to relay to openai API, but none worked correctly. Currently i'm stuck with this code https://github.com/vico93/falastrao_bot/blob/gpt/main.js but obviously it dont work. How can i achieve this?
8 replies