Fixed welcome
diff --git a/src/reflex/verify.ts b/src/reflex/verify.ts
index b95d5db..bc7aa4f 100644
--- a/src/reflex/verify.ts
+++ b/src/reflex/verify.ts
@@ -17,6 +17,7 @@
if ((!config.verify.enabled ) || (!config.verify.role)) return interaction.editReply({embeds: [new EmojiEmbed()
.setTitle("Verify")
.setDescription(`Verify is not enabled on this server`)
+ .setFooter({text: interaction.member.permissions.has("MANAGE_GUILD") ? "You can enable it by running /settings verify" : ""})
.setStatus("Danger")
.setEmoji("CONTROL.BLOCKCROSS")
], ephemeral: true, fetchReply: true});
diff --git a/src/reflex/welcome.ts b/src/reflex/welcome.ts
index 5b80fbd..9be71d5 100644
--- a/src/reflex/welcome.ts
+++ b/src/reflex/welcome.ts
@@ -1,41 +1,39 @@
-import log from '../utils/log.js'
import convertCurlyBracketString from '../utils/convertCurlyBracketString.js'
import client from '../utils/client.js';
+import EmojiEmbed from '../utils/generateEmojiEmbed.js';
export async function callback(_, member) {
if (member.bot) return
let config = await client.database.guilds.read(member.guild.id);
if (!config.welcome.enabled) return
- if (!config.welcome.verificationRequired.role) {
- if (config.welcome.welcomeRole) {
- try {
- await member.roles.add(config.welcome.welcomeRole)
- } catch (err) {
- console.error(err)
- }
- }
- }
-
- if (!config.welcome.verificationRequired.message && config.welcome.channel) {
+ if (config.welcome.channel) {
let string = config.welcome.message
if (string) {
string = await convertCurlyBracketString(string, member.id, member.displayName, member.guild.name, member.guild.members)
-
if (config.welcome.channel === 'dm') {
try {
- await member.send(string)
- } catch (err) {
- console.error(err)
- }
+ await member.send({
+ embeds: [new EmojiEmbed()
+ .setDescription(string)
+ .setStatus('Success')
+ ]
+ })
+ } catch {}
} else {
- let channel = await member.client.channels.fetch(config.welcome.channel)
+ let channel = await member.guild.channels.fetch(config.welcome.channel)
if (channel.guild.id !== member.guild.id) return
if (!channel) return
try {
- await channel.send(string)
+ await channel.send({
+ embeds: [new EmojiEmbed()
+ .setDescription(string)
+ .setStatus('Success')
+ ],
+ content: (config.welcome.ping ? `<@${config.welcome.ping}>` : '') + `<@${member.id}>`
+ })
} catch (err) {
- console.error(err)
+ console.error(err) // SEN
}
}
}