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

Random default emoji! #551

Merged
merged 2 commits into from
Sep 25, 2024
Merged

Random default emoji! #551

merged 2 commits into from
Sep 25, 2024

Conversation

mgwalker
Copy link
Contributor

@mgwalker mgwalker commented Sep 24, 2024

It would be super neat if our random responses could define a random emoji to be used when posting them. This PR makes that so. Screambot will be in for such a delightful update.


Checklist:

  • Code has been formatted with prettier
  • The OAuth wiki
    page has been updated if Charlie needs any new OAuth events or scopes
  • The Environment Variables
    wiki page has been updated if new environment variables were introduced
    or existing ones changed
  • The dev wiki has been updated, e.g.:
    • local development processes have changed
    • major development workflows have changed
    • internal utilities or APIs have changed
    • testing or deployment processes have changed
  • If appropriate, the NIST 800-218 documentation has been updated

@mgwalker mgwalker requested a review from a team as a code owner September 24, 2024 21:01
// If it's a list, pick one at random.
if (Array.isArray(defaultEmoji)) {
message.icon_emoji =
defaultEmoji[Math.floor(Math.random() * defaultEmoji.length)];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if defaultEmoji is an array with length 0?

Copy link
Contributor Author

@mgwalker mgwalker Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trust me. It works.

(...now, anyway)

@zachmargolis zachmargolis mentioned this pull request Sep 25, 2024
2 tasks
@mgwalker mgwalker merged commit 8539c12 into main Sep 25, 2024
7 checks passed
@mgwalker mgwalker deleted the mgwalker/support-random-user-icons branch September 25, 2024 21:56
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

Successfully merging this pull request may close these issues.

2 participants