cqllin
cqllin
DIAdiscord.js - Imagine an app
Created by cqllin on 10/5/2023 in #djs-questions
TypeScript GuildText Channel Type help
I am attempting to fetch a channel to send a welcome message in my guildMemberAdd event. However, I am getting this type error:
Property 'send' does not exist on type 'GuildBasedChannel'.
Property 'send' does not exist on type 'CategoryChannel'.ts(2339)
Property 'send' does not exist on type 'GuildBasedChannel'.
Property 'send' does not exist on type 'CategoryChannel'.ts(2339)
Here is my event:
import { Events, GuildMember, EmbedBuilder } from "discord.js";
import { Event } from "../interfaces";

const event: Event = {
name: Events.GuildMemberAdd,
execute: async (client, member: GuildMember) => {
if (!member || member == null) return;

const embed = new EmbedBuilder()
.setTitle('New Member Joined')
.addFields(
{ name: 'Member', value: member.user.username, inline: true },
{ name: 'Member ID', value: member.id, inline: true })
.setColor("Green")
.setFooter({ text: `${client.user?.username}` })

const channel = member.guild.channels.cache.get("1060224954035081276");
if (channel) {
channel.send({ embeds: [embed] })
}
}
}
import { Events, GuildMember, EmbedBuilder } from "discord.js";
import { Event } from "../interfaces";

const event: Event = {
name: Events.GuildMemberAdd,
execute: async (client, member: GuildMember) => {
if (!member || member == null) return;

const embed = new EmbedBuilder()
.setTitle('New Member Joined')
.addFields(
{ name: 'Member', value: member.user.username, inline: true },
{ name: 'Member ID', value: member.id, inline: true })
.setColor("Green")
.setFooter({ text: `${client.user?.username}` })

const channel = member.guild.channels.cache.get("1060224954035081276");
if (channel) {
channel.send({ embeds: [embed] })
}
}
}
5 replies
DIAdiscord.js - Imagine an app
Created by cqllin on 2/23/2023 in #djs-questions
Does the guildAuditLogEntryCreate event work on v14?
As the title states, I am curious if this event that was recently announced for v13 also works for v14. I have gave my bot the GUILD_MODERATION intent, and even tried giving the specific partial but no prevail. The event does not fire at all.
module.exports = {
name: "guildAuditLogEntryCreate",
async execute (auditLogEntry) {
console.log(auditLogEntry);
console.log('test')
}
}
module.exports = {
name: "guildAuditLogEntryCreate",
async execute (auditLogEntry) {
console.log(auditLogEntry);
console.log('test')
}
}
4 replies
DIAdiscord.js - Imagine an app
Created by cqllin on 2/12/2023 in #djs-questions
What is the best character set and collation for MySQL databases for Discord bot purposes?
Hello! As many people use MongoDB, I do know Mongo. However before you say to just use Mongo, I personally prefer MySQL and also this data will be used for other things that already use MySQL. I currently have some database tables setup with the character set utf8mb4 with the collation set to utf8mb4_unicode_ci. However even with the unicode collation, when someone uses an emoji or a like a chinese text character, the database errors and does not save most of the time. One of the main reasons why I use this specific character set and collation, is because as said before this data is used for other things such as: FiveM server, websites, multiple Discord bots, etc - so the goal is to keep it as universal as possible with what characters and text it can accept. It may not be able to be perfect, but if anyone has any better suggestions than the one I am currently utilizing - I'd love to hear them. Thanks!
3 replies
DIAdiscord.js - Imagine an app
Created by cqllin on 1/8/2023 in #djs-questions
Listing new permissions with channelCreate event - permissionOverwrites
11 replies