shukriadams / discord-giveawaybot

A Discord bot that gives games away. Written in NodeJS.
MIT License
30 stars 22 forks source link

You don't have permission to create a giveaway #10

Open Skyridr opened 6 years ago

Skyridr commented 6 years ago

For some odd reasons, I started to get this message.

I can no longer create giveaways, regardless if I'm in the role. I even made a new one and changed the giveawayrole to the new one, still the same message. I didn't change or do anything. Was able to create giveaways just fine and suddenly poof, locked out.

No logs about it.

This is before I and after I updated to the new version, affects both.

I disabled the following:

// user needs to be admin or have giveaway permission
//let hasPermission = await permissionHelper.isAdminOrHasRole(client, message.author, settings.values.giveawayRole);
//if (!hasPermission){
//    message.author.send('You don\'t  have permission to create a giveaway');
//    return codes.MESSAGE_REJECTED_PERMISSION;
//}

And I was able to create giveaways again. Even though the commands were missing from help:

[12:35 AM] Skyrider: help [12:35 AM] Shenron: Hi, I'm giveaway bot. I give things away on your behalf. My commands are : brackets : price brackets for games. help : displays this text. list : lists giveaways. me : Tells you if you're on cooldown. rules : shows rules. Command --help or -h gets you detailed instructions, egs list --help. All commands should be sent to me in direct chat (PM).

It appears there's something wrong with the admin/role check?

shukriadams commented 6 years ago

I think this is a Discord issue, it shows up occasionally and always seems to resolve itself after a few hours.

Skyridr commented 6 years ago

Indeed it was.

Made a suggestion that whenever this happens it'll fall back to user ID checks.

Skyridr commented 6 years ago

It's weird though, it's happening again and again in the night time. Is discord that messed up? O_O

EDIT:

Last night around 12AM, got the no permission error, now at 10:43AM (almost 12 hours later), same error.

shukriadams commented 6 years ago

This is clearly a problem. I need to take it up with Discord group to see if it can be solved there, if not, I'll look at coding a workaround. Hoping to avoid the latter - the bot already has a bunch of clunky discord workarounds I'd like to get rid of.

shukriadams commented 5 years ago

Update : this is caused by your user not being a member of the guild your discord server is associated with. Why you're getting this error I can't say, as it doesn't seem to be affecting anyone else.

Skyridr commented 5 years ago

Update : this is caused by your user not being a member of the guild your discord server is associated with. Why you're getting this error I can't say, as it doesn't seem to be affecting anyone else.

Well it also happens to me and I'm the hoster/owner of the bot/server. So that's quite weird.