ianmarmour / nvidia-clerk

A cross-platform go bot that tracks for availability of stock from Nvidia's store and adds a cart to your checkout.
BSD 3-Clause "New" or "Revised" License
222 stars 64 forks source link

Add a way to customize Discord webhook notifications #107

Open redstone2019 opened 3 years ago

redstone2019 commented 3 years ago

I just want to add a webhook to my server that says something like "MODEL_NAME available at RETAILER_NAME. URL here: WEBSITE_URL" Current code for my script: @ECHO OFF TITLE NVIDIA Clerk ECHO This is for a Discord Webhook Bot, close window if you didn't mean to open this. PAUSE SET DISCORD_WEBHOOK_URL=https://discordapp.com/api/webhooks/############# C:\Users\nater\nvidia-clerk-windows.exe -discord -region=USA -model=3080 PAUSE

riky503 commented 3 years ago

Could we additionally add a way to specify the roleID or userID we want to be tagged on the message itself? Would make it easier to see notifications without having the whole channel set to notify all.

cmsj commented 3 years ago

Could we add the URL for the page that has the card already in the cart, to the Discord notification?

redstone2019 commented 3 years ago

no because only one person can use that link

ianmarmour commented 3 years ago

@cmsj So yes and no, using -remote will allow for this behavior however there's no way to open the browser and to use that URL.

electronstorm commented 3 years ago

I added an @everyone for myself and recompiled it. That works pretty well but obviously isn't generic enough.

@ianmarmour I think an environment variable with a template should catch most of these cases. This could be a string that replaces a template value such as with the actual URL. A second template with a could make sense when the bot is shared by multiple people.

alopex92 commented 3 years ago

how about just adding a "custom_msg_prefix" parameter to the program and then, in the notify function prepend the url variable (which is a message string at this point) with it.

That way the user can have a per process custom message like "@everyone something ".