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

mentioning any role crashes webhook logs #273

Closed
solareon opened this issue Dec 5, 2023 · 3 comments
Closed

mentioning any role crashes webhook logs #273

solareon opened this issue Dec 5, 2023 · 3 comments
Labels
bug Something isn't working need repro This bug report needs confirmation

Comments

@solareon
Copy link
Member

solareon commented Dec 5, 2023

Summary

When passing any tag to the logger module with a webhook fails

Reproduction

Pass a log to the logger module with a webhook and a tag

Expected behavior

Webhook to post with tag

Actual behavior

Error on console and no webhook

Additional context

[script:qbx_smallreso] SCRIPT ERROR: @qbx_core/modules/logger.lua:55: attempt to concatenate a nil value (field '?')
[script:qbx_smallreso] > logPayload (@qbx_core/modules/logger.lua:55)
[script:qbx_smallreso] > fn (@qbx_core/modules/logger.lua:84)

Additionally the logger documentation should reflect that roles other than @everyone or @here need to be called using user/role ids or the user will not be tagged.

Last Updated

today

Custom Resources

n/a

Resource Rename

n/a

@solareon solareon added bug Something isn't working need repro This bug report needs confirmation labels Dec 5, 2023
@Manason
Copy link
Member

Manason commented Dec 6, 2023

Do you know why this might be occurring? The code looks to protect against nil values here https://github.com/Qbox-project/qbx_core/blob/main/modules/logger.lua#L54-L55

@solareon
Copy link
Member Author

solareon commented Dec 6, 2023

It seems to be related to how it handles the payload.tags[i] which I guess doesn't look like a table when it's just a single value. Looking at the docs again this might be me being a bonehead not wrapping my payload tags in [].

@solareon
Copy link
Member Author

solareon commented Dec 6, 2023

Okay this was due to not wrapping the @everyone in {} like this {'@everyone'}. Doing that fixed it up.

@solareon solareon closed this as completed Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need repro This bug report needs confirmation
Projects
Status: Done
Development

No branches or pull requests

2 participants