antares-network / antaresbot Goto Github PK
View Code? Open in Web Editor NEWA small bot with a hodgepodge of features and cool commands. Have fun with it :P
Home Page: https://bot.antaresnetwork.com/
License: Other
A small bot with a hodgepodge of features and cool commands. Have fun with it :P
Home Page: https://bot.antaresnetwork.com/
License: Other
Type assertion is explicitly telling the compiler that we want to treat the entity as a different type but if we add a type assertion for a variable which automatically treats the variable with the same type then it is unnecessary to define type. Using a type assertion that does …
There are 3 occurrences of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/Antares-Network/AntaresBot/issue/JS-0349/occurrences/
Causes bot to crash
guildUpdate does not have a full list of guild changes and spits out a spam of Error: No update found
Condition guildBan.banUser(user)
is always true because it evaluates to a 'Promise' object. The value of expression guildBan.banUser(user)
is originated from the return value of banUser()
defined at line 5 of actions/guildBan.js.
run(message, { user }) {
if (guildBan.banUser(user)) {
//if the user was banned respond with this
Empty block statements, while not technically errors, usually occur due to refactoring that wasn't completed. They can cause confusion when reading code and add unnecessary lines to the codebase. Example - The not-preferred way :
if (foo) { } while (foo) { } switch(foo) { } try { doSomething();
There is 1 occurrence of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/Antares-Network/AntaresBot/issue/JS-0009/occurrences/
currently, those people banned from using the bot can still participate in the counting channels of those guilds that have set them up
eh it looks ok right now but it could be better
I'm looking for a way to completely restart the entire NodeJs app from within the bot's code.
I want the js to do the equivalent of ctrl+c
and then npm start
but it needs to happen from within the js code of my bot.
What is there right now currently just signs in and out of the discord api/destroyes the old client
and creates a new one
message.channel.send('Restarting...');
console.log('\n\n\n\n\n\n\n\n')
bot.destroy();
console.log("Signed out of the Discord API".red.bold);
bot.login(process.env.BOT_TOKEN).catch(e => console.error(e));
console.log('Trying to login to the Discord API\nPlease wait for a connection'.yellow);
onReady.event(bot);
console.log("Logged into the Discord API".green.bold);
console.log("Startup script has run".red.bold);
logToConsole.command(message.guild, message);
convert all exact paths to have aliases
replace https://antaresnetwork.com/resources/icon.png
in embeds, etc when the bot icon is needed, with https://cdn.discordapp.com/avatars/${client.user?.id}/${client.user?.avatar}.jpeg
the guildMemberAdd
and guildMemberRemove
events do not respect the ignored guilds list
botbanguild does not display the correct message when banning a guild from using the bot
i guess this is being worked on now lol
you must mention a user in the botbanuser command. you can not specify a user id
Similar issue to #83 where there is a lot of similar code that could be combined and then arguments passed so that it condenses the entire file
add music option from Spotify and or last.fm and or SoundCloud or something
add something like
.catch((err) => { channel.send("Error")});
to each message send instance, or find a way to handle errors better
Convert log messages sent to channels appear as embeds
Redundant code needs to be cleaned up in ChannelCheck.js
It needs to be simplified if at all possible
Example:
//check if the user has been banned from using the bot
if (gate.BANNED_USERS.includes(messageAuth.id)) {
message.delete();
const banEmbed = new MessageEmbed()
.setColor('#ff3505')
.setTitle('User ban notice')
.setDescription(`<@${messageAuth.id}>, You have been banned from using this bot by the owner.`,);
message.channel.send(banEmbed)
.then(msg => {
msg.delete({ timeout: 20000 })
})
return;
}
and
//check if the guild has been banned from using the bot
if (gate.BANNED_GUILDS.includes(message.guild.id)) {
message.delete();
const banEmbed = new MessageEmbed()
.setColor('#ff3505')
.setTitle('Guild ban notice')
.setDescription(`<@${messageAuth.id}>, This guild has been banned from using this bot by the owner.`,);
message.channel.send(banEmbed)
.then(msg => {
msg.delete({ timeout: 20000 })
})
return;
}
Condition guildBan.banGuild(guildID)
is always true because it evaluates to a Promise
object. The value of expression guildBan.banGuild(guildID)
is originated from the return value of banGuild()
defined at line 35
run(message, { guildID }) {
if(guildBan.banGuild(guildID)) {
//if the user was banned respond with this
botbanuser does not display the correct message when a user is banned from using the bot
Using an if-else
statement typically results in more lines of code than a single-line ternary expression, which leads to an unnecessarily larger codebase that is more difficult to maintain. Additionally, using an if-else
statement can result in defining variables using let
or var
solely to be reassigned within the blocks. …
There are 2 occurrences of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/Antares-Network/AntaresBot/issue/JS-D009/occurrences/
Comparing to null
without a type-checking operator (===
or !==
), can have unintended results as the comparison will evaluate to true when comparing to not just a null
, but also an undefined
value.
There are 6 occurrences of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/Antares-Network/AntaresBot/issue/JS-0059/occurrences/
Escaping non-special characters in strings, template literals, and regular expressions doesn't have any effect.
There are 5 occurrences of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/Antares-Network/AntaresBot/issue/JS-0097/occurrences/
uh it doesn't exist yet
On start with the AntaresBot token, a guildDelete event is emitted. Had to build in some logic to ignore this but it needs to be resolved
Describe the bug
Bot feature links are broken in README
To Reproduce
Go to repo AntaresBot
Click on Bot Features links
Expected behavior
Links should bring you somewhere :)
bot crashes when it does not have permissions to talk in a particular channel and it is forced to do so. this is a MAJOR problem why does it do this
I don't have any idea how to do this but I will try
it looks terrible right now.
Condition guildBan.unBanGuild(guildID)
is always true because it evaluates to a Promise
object. The value of expression guildBan.unBanGuild(guildID)
is originated from the return value of unBanGuild()
defined at line 53 of actions/guildBan.js.
run(message, { guildID }) {
if (guildBan.unBanGuild(guildID)) {
//if the guild was unbanned respond with this
start looking into slash commands. add to all appropriate commands.
make the bot react to all messages that start with the bot's prefix but arent actual commands. then if someone clicks on the bot's reaction, it will explain that the command they entered is not a valid command.
The any
type can sometimes leak into your codebase. TypeScript compiler skips the type checking of the any
typed variables, so it creates a potential safety hole, and source of bugs in your codebase. We recommend using unknown
or never
type variable.
There is 1 occurrence of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/Antares-Network/AntaresBot/issue/JS-0323/occurrences/
MongoClient is defined and never used
index.js
3 const MongoClient = require('mongodb').MongoClient;
Found variables that are declared but not used anywhere. <!--more--> Variables that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring. Such variables take up space in the code and can lead to confusion by readers. Also, having unused variables affects …
There are 8 occurrences of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/Antares-Network/AntaresBot/issue/JS-0128/occurrences/
add buttons for commands and see if menus would be a viable option in the future
Make all ban and unban commands need to go thru dm's and not thru channels. Also send a copy of all messages to the bot owner with all the relevant information
Same as #93
Replace all instances of the bot
object with this.client
or find a way to setup an object alias so that any references to bot
get translated to this.client
so that the bot object does not have to be global and can have its scope locally in index.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.