Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Add: Joke module #53

Merged
merged 9 commits into from
Nov 15, 2023
Merged

Add: Joke module #53

merged 9 commits into from
Nov 15, 2023

Conversation

Zephira58
Copy link
Contributor

@Zephira58 Zephira58 commented Nov 11, 2023

Added a basic joke module using an API. I tried to get it to search for if the current channel had NSFW enabled, but I couldn't figure out how to parse the data correctly on a channel level, only a guild one. Be sure to let me know if you want any changes done

src/modules/joke.ts Outdated Show resolved Hide resolved
src/modules/joke.ts Outdated Show resolved Hide resolved
src/modules/joke.ts Outdated Show resolved Hide resolved
src/modules/joke.ts Outdated Show resolved Hide resolved
@Cpt-Dingus
Copy link
Collaborator

Personal nit

  'joke', // command name
  'Get a funny joke from the bot', // command description
  [], // dependencies
  [], // options

I don't think these comments should be present outside of a testing environment

Now i'm running into an issue where sometimes it fetches the joke perfectly with no issues, but other times i get a `Invalid Form Body` error.
@Zephira58
Copy link
Contributor Author

Zephira58 commented Nov 11, 2023

Now I'm running into an issue where sometimes it fetches the joke perfectly with no issues, but other times i get a Invalid Form Body error from within the discordjs itself it seems and crashes the whole bot. And I'm not entirely sure how to resolve this issue. Or even replicate it on a consistent basis. I would appreciate any insight you might have. I appreciate the feedback and help, i'm still learning TS and tbh with you this is my first time attempting to colab in a project so its all very new to me 😅

I'll look into the issue more on my side and see if i can figure anything out, just thought i'd post here incase your faster then me 👍

image
image

@zleyyij
Copy link
Collaborator

zleyyij commented Nov 12, 2023

Try using console.log to verify that the joke is a valid string before sending it. embeds[0].description is the field that was not set correctly.

I feel so dumb, there was a tiny typo that broke the entire thing, and i forgot to format the response as a string 😭
src/modules/joke.ts Outdated Show resolved Hide resolved
@zleyyij wanted it so i implemented it
@Cpt-Dingus
Copy link
Collaborator

LGTM

@zleyyij zleyyij merged commit d6ba09c into r-Techsupport:main Nov 15, 2023
1 check passed
@Zephira58 Zephira58 deleted the joke-module branch November 15, 2023 16:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants