Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord - cannot find user by discord handle with or without tag #226

Open
mechaming opened this issue Mar 9, 2021 · 4 comments
Open

Discord - cannot find user by discord handle with or without tag #226

mechaming opened this issue Mar 9, 2021 · 4 comments

Comments

@mechaming
Copy link

Maybe i'm doing something wrong but when updating botadmins it cannot find my account unless I use the GUID*? for my discord handle

Expected Behavior

Adding my discord handle to admins .psd1 should allow me to be an admin with the bot

Current Behavior

Adding my discord handle to admins .psd1 with or with # doesn't give me access BUT if I use my GUID that I read in the output it does work

Possible Solution

Mechanism to resolve discord name to GUID?

Steps to Reproduce (for bugs)

Doesn't work:

$pbc.BotAdmins = @('botaccount','mydiscordhandle')

$pbc.BotAdmins = @('botaccount','mydiscordhandle#1234')

Works: GUID is from verbose output

$pbc.BotAdmins = @('botaccount','12213214342342')

WARNING: {"DataTime":"2021-03-09 17:41:26Z","Class":"DiscordBackend","Method":"UsernameToUserId","Severity":"Warning","LogLevel":"Debug","Message":"User [mydiscordhandle'] not found. Refreshing users","Data":null}
WARNING: {"DataTime":"2021-03-09 17:41:26Z","Class":"DiscordBackend","Method":"UsernameToUserId","Severity":"Warning","LogLevel":"Debug","Message":"Could not resolve user [mydiscordhandle']","Data":null}
WARNING: {"DataTime":"2021-03-09 17:41:26Z","Class":"Bot","Method":"_LoadAdmins","Severity":"Warning","LogLevel":"Info","Message":"Unable to resolve ID for admin [mydiscordhandle']","Data":null}

Context

Trying to test out bot but can't do anything as I can't run any commands

Your Environment

Windows 10 Pro
Powershell Version : 7.1.2

@mechaming
Copy link
Author

Okay so I did a little more testing yesterday. I added my discord account to the admin group by using discord ID to give that account access to run commands. To test the username to userid function I tried adding myself to the group through the channel.

!add-groupuser -group admin -name (here I would do the @ and then pull the account I want to have access). This resulted in user not found error from the bot.

I double checked the permissions for the bot in the channel and it has administrator privileges.

@devblackops Would you have any time to assist with me with this?

@AndrewJNet
Copy link

Seeing the same issue with a new PoshBot/Discord integration.

@mechaming could you tell me how you made the user an admin by using the ID directly?

@AndrewJNet
Copy link

image

@mechaming you may want to try toggling this option, it worked for me. If you want to verify this works for you we can update the documentation to indicate this needs to be toggled on.

@eyeiodine
Copy link

image

@mechaming you may want to try toggling this option, it worked for me. If you want to verify this works for you we can update the documentation to indicate this needs to be toggled on.

I can confirm, I had this problem, and this was the fix for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants