mirror of
https://github.com/System-End/Discord-Bot.git
synced 2026-04-19 16:28:26 +00:00
Fixed 2 bugs
This commit is contained in:
parent
bf374e7224
commit
daccc918bd
2 changed files with 8 additions and 13 deletions
|
|
@ -30,7 +30,7 @@ module.exports = async (client, interaction, args) => {
|
|||
Schema.findOne({ Guild: interaction.guild.id, User: user.id }, async (err, targetData) => {
|
||||
if (targetData) {
|
||||
var targetMoney = targetData.Money;
|
||||
if (targetData = undefined || !targetData || targetData.Money == 0 || targetData.Money < 0) {
|
||||
if (targetData = undefined || !targetData || targetMoney == 0 || targetMoney < 0) {
|
||||
return client.errNormal({ error: `${user.username} does not have anything you can rob!`, type: 'editreply' }, interaction);
|
||||
}
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ module.exports = async (client, interaction, args) => {
|
|||
}, interaction);
|
||||
}
|
||||
else {
|
||||
return client.errNormal({ error: `${user.user.username} does not have anything you can rob!`, type: 'editreply' }, interaction);
|
||||
return client.errNormal({ error: `${user.username} does not have anything you can rob!`, type: 'editreply' }, interaction);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,21 +36,16 @@ module.exports = async (client, interaction, args) => {
|
|||
}, interaction).then(msg => {
|
||||
const filter = i => i.user.id === interaction.user.id;
|
||||
|
||||
interaction.channel.awaitMessageComponent({ filter, max: 1, componentType: 'SELECT_MENU' }).then(async i => {
|
||||
interaction.channel.awaitMessageComponent({ filter, max: 1, componentType: Discord.ComponentType.StringSelect }).then(i => {
|
||||
if (i.customId == 'gender-setup') {
|
||||
data.Gender = i.values[0];
|
||||
data.save();
|
||||
|
||||
client.api.interactions(i.id, i.token).callback.post({
|
||||
data: {
|
||||
type: 4,
|
||||
data: {
|
||||
content: `Your gender is set`,
|
||||
embeds: [],
|
||||
flags: 64,
|
||||
}
|
||||
}
|
||||
});
|
||||
client.succNormal({
|
||||
text: "Set your gender to " + i.values[0],
|
||||
type: 'editreply',
|
||||
components: [],
|
||||
}, interaction);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue