Jump to content

Configuring Bug Reports


Naton

Recommended Posts

Background

A recent TRiBot update added the ability to automatically send bug reports to you if your script crashes via an exception. The bug report is sent through a discord webhook that your script sets.

You can also include custom data in the bug report, such as script settings.

Additionally, there will be an option to 'Send to Scripter' when a user generates a bug report manually and you have a discord webhook set up so you can easily get the info you need without hassle.

 

Why should I use this?

It will make it easier for users to generate bug reports and send them to you. It will also add some automated monitoring to your scripts to ensure that your scripts are running as you expect. It also allows you to figure out issues more easily by adding extra information into the bug report that may be specific to your script.

 

Why a discord webhook?

* It's free
* It's simple
* Many are familiar with them

 

How to get started

1) Set up a discord webhook. Follow this tutorial by Encoded. Note: Skip the adding webhook to TRiBot part, your script will apply it separately.

https://community.tribot.org/topic/84377-discord-webhook-notification-tutorial

 

2) Take the URL from the previous step and configure the webhook at the start of your script.

import org.tribot.script.sdk.util.BugReports;

...

var webhookConfig = BugReports.WebhookConfig.builder()
		.discordWebhookUrl("discord webhook url here")
		.sendOnException(true)
		.build();
BugReports.configureWebhooks(webhookConfig);

 

3) (Optional) Configure extra script data. This can be things like the script settings. This will be added to a file called script-data.txt inside the generated bug report. (Note this can be configured without having webhooks set up)

import org.tribot.script.sdk.utill.BugReports;

...

BugReports.setExtraScriptData(() -> {
	return getMySettingsAsString();
});

 

 

Result

Users will see this when generating a bug report

7ee17dfd7f8c096ab5c5fe5d1a4ba502.png

 

Manually sent bug reports will look like

b317bc3ee3c34ace6c09c168b8ea7307.png

 

Automated bug reports will look like

dbba68023c9ed90d013a10c830ed8910.png

Edited by Naton

View all my bots on the TRiBot store! (premium) (free)

Need assistance with any of my bots? Join the nScript support discord (link below).

nScripting.com    nScript Support Discord     Refund Policy

Automate your bot management through nRestocker and the TRiBot Bulk Launcher

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...