A bot made with the Discord.js library for the 1-Up World Discord server, discord.gg/mario!
pdinsdale / battlebot Goto Github PK
View Code? Open in Web Editor NEWDiscord.js bot for the 1-Up World Discord server
Home Page: https://discord.gg/mario
Discord.js bot for the 1-Up World Discord server
Home Page: https://discord.gg/mario
A bot made with the Discord.js library for the 1-Up World Discord server, discord.gg/mario!
https://github.com/Phoenix1128/BattleBot/blob/0e8036a213d047f0370e6fa6fd571998215a233a/bot.js#L118
I don't mind this blacklist existing, but I would rather they be parsed from a text file or something like that, and possibly also excluded from the git repo but that's up to you. If you embed this in the source code, you have to restart the bot every time you update it, or do something similarly nasty. If you update it in a txt file or json, all you need to do is run a command to update the list with the new contents of the file.
suggestion
Strings should just be in a numbered array, and you use the random number as an index into it. No need for a long switch case.
If an error is caught, the parameter passed in the anon function is not the same as the then
block. It will simply return an error that you're meant to print to the console for description of what went wrong. collection.size will always be null; you should instead be printing it directly, and assume that the entire command failed.
This should definitely not be hard-coded. Please use the Date class to check if the queried year is greater than the current, then same for the month.
I really hate seeing emojis inside of source code. My intuition is telling me there's a more kosher way to do this.
There should be no references to 'mario' or 'luigi' in the bot's code. Ideally, more than 2 factions should be supported, but for now I would work on refactoring this code so you're not repeating the same blocks of code twice when you could just be passing in parameters to a single function.
This really needs to be data driven. An object which maps years to months, and months to faction battle data would work.
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.