diff --git a/README.md b/README.md new file mode 100644 index 0000000..f8c28aa --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# ElectionsBot + +A political bot for Discord that returns data, results, and more. + +# Quickstart +``` +npm i +tsc +node dist/index.js +``` \ No newline at end of file diff --git a/config.example.json b/config.example.json new file mode 100644 index 0000000..2b4cf65 --- /dev/null +++ b/config.example.json @@ -0,0 +1,3 @@ +{ + "token": "INSERT_TOKEN_HERE" +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 1108a40..b0b73b1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -153,6 +153,10 @@ if (!config.token) { return; } } + if (overlayopacity > 100 || overlayopacity < 0) { + await i.editReply("Invalid opacity!"); + return; + } var result = await MakePrediction(election, overlayimage?.url, overlayopacity ? Math.round((overlayopacity / 100) * 255) : 255); var embed = new EmbedBuilder() .setTitle(election.title)