🗒️ Note: 
You're reading red3.4 documentation. 
Go back to latest ▸

Coffee-cogs for Red 3.4

This is not recommended in the long term, as Red/Discord.py itself may break. Please upgrade if you can.

[p]repo add coffee-cogs-red-3.4 https://github.com/coffeebank/coffee-cogs/tree/red-3.4
[p]cog install coffee-cogs-red-3.4 hellohook
Logo: a resting cat being scratched in the chin

Hellohook (for Red 3.4)

Drafting your Webhook Message

Get started on Discohook >

When you are done on Discohook:

  • Scroll to the bottom
  • Click "JSON Data Editor"
  • Click "Copy to Clipboard"
  • Paste it into the bot command

Disclaimer: Discohook is a website that makes creating webhooks easy. Not affiliated with this cog. Image from Unsplash.


Variables

https://&&SERVERCOUNT&& for server member count (268)

https://&&SERVERCOUNTORD&& for server member count with the th/st/nd ordinals (268th)

https://&&USERAVATAR&& for user profile picture url

https://&&USERMENTION&& for user mention (<@1234567890123456>)

  • User mentions can only be used in Content, or the Embed's Body Description, or they won't appear correctly.

https://&&USERNAME&& for username as text (Clyde)

https://&&USERNAME1234&& for username#1234 as text (Clyde#1234)


Adding https:// in front is required.
Discohook will not export the needed JSON if it says "Invalid URL" (even though the bot will make them valid at runtime), so this is a workaround.


Examples

After you save them into the bot, when a new user joins, the variables will be replaced with the new user's info.


FAQ

Hellohook and the test command doesn't send anything!

First, check your Red Bot console.

If it says send() got an unexpected keyword argument '####', please let me know in the Support Discord or file a GitHub bug report.

As of 10 June 2022, this has been patched, but may happen again in the future.

Hellohook still works, but Greet Message is empty!

Note for old users: Data has been upgraded to V2 system as of late 2021. Your data is saved. Greet Message will show as empty until a new user joins, which will activate the data migration process automatically. See [p]hellohook set for more info.

How do I send a webhook styled as the person who joined?

This feature is not recommended. But, Hellohook is open-source, so I encourage you to customize the bot by forking the code.

What you want to edit is:

return await webhook.send(**greetMessageJson)

Replace it with:

return await webhook.send(**greetMessageJson,
    username=userObj.display_name,
    avatar_url=userObj.avatar_url)

Image: Replacing code under Utility Commands async def hellohookSender()

Forking Hellohook

Hellohook is flexible, but may not be flexible enough for everyone's needs. Hellohook is open-source and encourages you to customize by making tweaks.

Fork Repo

  1. Go to coffeebank/coffee-cogs and click Fork at the top. Check to only fork master branch.
  2. You should now be at USERNAME/coffee-cogs. Click into hellohook folder here
  3. Make the edits you would like, then click Save (join the Support Discord if you need help)
  4. Add the repo to your bot by typing in Discord (replacing with your GitHub username from above):
    [p]cog uninstall hellohook
    [p]repo add coffee-cogs2 https://github.com/USERNAME/coffee-cogs
    [p]cog install coffee-cogs2 hellohook

Updates

  1. Visit your copy of the GitHub repo at USERNAME/coffee-cogs
  2. Click "Fetch upstream" and merge updates
  3. On Discord, type:
    [p]cog update hellohook