Code Monkey home page Code Monkey logo

shiro's Introduction

Shiro Discord Bot

Shiro ©2018-2021 Shinwulf

A Discord Bot with focus on Fun, Moderation, Utility commands and much more.

IMPORTANT INFORMATION

YOU ARE FREE TO USE ITS CODE AS REFERENCE FOR YOUR OWN BOTS. NOTE THAT THIS BOT MAY NOT WORK AS A STANDALONE - IT IS OUTDATED

I WILL NOT BE PROVIDING ANY SUPPORT FOR THIS BOT AS IT MAY NOT FUNCTIONS ANYMORE, YOU ARE FREE TO OPEN ISSUES THOUGH

Table of Contents

Permissions

The bot needs several permissions to be able to do what it does. Below is every permission the bot asks for:

  • Create Instant Invite is needed to allow owners to join your server to test if needed.
  • View Audit Log is not needed yet, but is something the bot might utilize in the future.
  • Change Nickname is not needed, but is included as a basic permission.
  • View Channels is required for every single command to work.
  • Send Messages is required for every single command to work.
  • Manage Messages allows the bot to use the clear command.
  • Kick Members allows the bot to use the kick command.
  • Ban Members allows the bot to use various moderation commands.
  • Embed Links is required to allow commands that send embeds to work. A whole bunch of commands use this.
  • Attach Files is required to allow commands that send files to work. A whole bunch of commands use this.
  • Read Message History allows the bot to use the last-message and clear commands.
  • Use External Emojis allows the bot to use custom emoji in certain commands.
  • Add Reactions allows the bot to use commands that add reactions to messages in certain commands.

Interesting Information

  • 160+ commands
  • 22,000+ lines of code
  • 3 years of development
  • 400+ Commits

Installing

Before You Begin

  1. Make sure you have installed Node.js (you will need at least v14.0.0) and Git.
  2. Clone this repository with git clone https://github.com/Shinwulf/shiro.git.
  3. Run cd shiro to move into the folder that you just created.
  4. Create a file named .env and fill it out as shown in .env.example.

Windows

  1. Open an ADMIN POWERSHELL window.
  2. Run npm i -g --production windows-build-tools
  3. Run npm i --production in the folder you cloned the bot.
  4. After filling out the .env file, you can start the bot by running node shiro.js.

Mac

  1. Launch TERMINAL (can be found in Utilities folder)
  2. Run xcode-select --install
  3. You should now see a software update popup asking you the following: "The xcode-select command requires the command line developer tools. Would you like to install the tools now?" Click on the Install button to confirm, then Agree to the License Agreement when requested (have fun reading through that). All the command line developer tools will be installed to the /Library/Developer/CommandLineTools/ directory.
  4. After filling out the .env file, you can start the bot by running node shiro.js.

Ubuntu and other Debian-based systems

  1. Run apt update.
  2. Run apt upgrade to install the latest dependencies of your distro.
  3. Run apt install python to install python.
  4. Run npm i --production in the folder you cloned the bot.
  5. After filling out the .env file, you can start the bot by running node shiro.js.

Filling out the .env file

Getting all the API keys for your .env file can be a pain sometimes, that's why I've compiled a list here of where to go to get every single API key!

Bot-related Information

  • SHIRO_TOKEN= is the bot's token. You can get it from here.
  • SHIRO_PREFIX= is the default prefix of the bot. Can be changed to anything you want. Default is s.
  • SHIRO_ID= is the ID of your bot. This is so far only used for the rate command.
  • SHIRO_INVITE_LINK= is an invite link for the bot. As example: https://discordapp.com/oauth2/authorize?client_id=1234567891011&scope=bot&permissions=0123456789

This is a Channel ID for the channel you want to view feedback from. It's not really required, so you can delete it.

  • FEEDBACK_CHANNEL_ID= is simply the channel ID of any channel in the main server the bot should be in.

System

  • ADMIN= Bot Admin User ID. Not required, and totally optional.
  • OWNER= Bot Owner User ID. Used for Bot Owner commands.
  • SUPPORT= Bot Support User ID. Not required, and totally optional.

Feel free to change these roles for your server. It's not required to change them though. Defaults below. Those are for the permission level function, so that the bot knows who is an Admin, Moderator, or user.

  • MOD_ROLE= Moderator role on a server. Default is Moderator.
  • ADMIN_ROLE= Admin role on a server. Default is Administrator.

Emoji IDs (All of them are totally optional!)

  • BAN_EMOJI_ID= is used by the Moderation commands ban and forceban.
  • FEEDBACK_EMOJI_ID= is used by the Core command feedback.
  • KICK_EMOJI_ID= is used by the Moderation command kick.
  • REPORT_EMOJI_ID= is used by the Moderation command report.
  • WARN_EMOJI_ID= is used by the Moderation command warn.

API KEYS, Secrets, and more

Imgur Album IDs

As all of these keys are the same process, this is a little different. You need to first sign up for Imgur. Then you just need to go to your profile and make albums that contain the images for the command(s) you want to use. Use the ID of that album (look at the URL) as the variable. Yes, you need to fill these albums yourself.

Commands

Total Commands: 163

Action

Action Commands: 10

  • hand: Holds hands with the user you mentioned!
  • hug: Hugs the user you mentioned!
  • kiss: Kisses the user you mentioned!
  • lick: Licks the user you mentioned!
  • nom: Noms on the user you mentioned!
  • pat: Pats the user you mentioned on the head!
  • slap: Slaps the user you mentioned!
  • stare: Stares at the user you mentioned!
  • tickle: Tickles the user you mentioned!
  • wink: Winks at the specified user!

Anime

Anime Commands: 5

  • anime: Searches for an anime on Kitsu.io! If no anime name is given, it gives you a random suggestion!
  • awwnime: Cute anime girls!
  • booru: Searches for images on Safebooru! Keep in mind Safebooru's definition of safe!
  • manga: Searches for a manga with Kitsu.io!
  • waifu: Finds you a waifu from a database of many waifus! Others can vote on the waifu through reactions!

Bot Owner

Bot Owner Commands: 11

  • config: Modifies the default configuration for all guilds.
  • delete: Removes a user from the database for leveling.
  • eval: Evaluates arbitrary JavaScript.
  • exec: Evaluates arbitrary JavaScript.
  • filesize: Returns the value of the size of the specified file.
  • leave: Leaves the current server.
  • nonce: Sends a random number string used for checking message delivery.
  • reload: Reloads a command that has been modified.
  • restart: If running under PM2, the bot will restart.
  • shutodown: Shuts down Shiro.
  • status: Sets Shiro's presence/status.

Core

Core Commands: 11

  • changelog: Responds with the 10 latest commits.
  • commands: Displays all commands available for you.
  • donate: Responds with the bot's donation links.
  • feedback: Want to give feedback? Encountered any bugs?
  • help: Displays basic information or help for a command!
  • invite: Generates an invite link, for adding Shiro to a server.
  • ping: Shows the bot latency and gives it a rating.
  • prefix: Returns the command prefix for the current server.
  • settings: Allows you to view or change settings for your server.
  • stats: Shows some information about Shiro!
  • terms: Read Shiro's Terms of Service.

Games

Games Commands: 4

  • flip: Bet on prediction of the outcome of flipping a coin.
  • roll: Bet on prediction of the outcome of rolling a dice.
  • slots: Spin the slot machine! You win if all 3 reels stop at the same emojis.
  • trivia: Put your general knowledge to the test!

Info

Info Commands: 12

  • avatar: Sends your avatar or the mentioned user's avatar.
  • channel: Displays information about the current channel.
  • discrim: Searches for users with the specified discriminator.
  • emoji: Displays information about the specified emoji.
  • emoji-image: Sends the specified emoji as an image.
  • icon: Sends the current server's icon.
  • last-message: Returns the mentioned user's last message.
  • permission-level: Displays your permission level for your location.
  • pi: Returns the value of Pi (π).
  • server: Displays information about the current server.
  • time: Returns the current time in a specified timezone.
  • user: Displays information about the mentioned user.

Moderation

Moderation Commands: 12

  • ban: Bans the mentioned user from the server.
  • clear: Clears (bulk-deletes) between 2 and 99 messages.
  • clear-nickname: Clears a user's nickname.
  • fetch-bans: Checks how many users are banned on the current server.
  • force-ban: Bans a user, even if they aren't in your server.
  • kick: Kicks the mentioned user from the server.
  • list-bans: DMs you a list of banned users.
  • lockdown: Locks a channel down for a set duration. Use "lockdown release" to end the lockdown prematurely.
  • mute: Mutes the mentioned user.
  • report: Reports a user to the server's staff.
  • unmute: Undoes the mentioned user's mute.
  • warn: Warns the mentioned user.

NSFW

NSFW Commands: 25

NSFW commands won't be listed here for many reasons. If you want to see what kind of NSFW commands this bot has, go to commands/NSFW.

Other

Other Commands: 4

  • horoscope: Gets your daily horoscope!
  • lmgtfy: Why don't you just... Google it?
  • rate: Gives the item you specify a rating out of 10!
  • tableflip: Flips a table, in real-time! (╯°□°)╯

Productivity

Productivity Commands: 11

  • calculate: Evaluates/calculates a given mathematical expression.
  • capture-screenshot: Captures a screenshot of a given URL.
  • choose: Choose an item from a list you provide.
  • color: Shows a random color or a preview of the given color!
  • create-emoji: Creates a new emoji.
  • generate-invite: Generates an invite link of the current text channel of your Discord server.
  • poll: Starts a poll in the current text channel asking users to vote with the specified time. If no time is specified, poll ends in 60 minutes.
  • prime-number: Checks if a number is a prime number.
  • reminder: Sets a reminder for you with the given time.
  • shorten: Shortens the specified link.
  • translate: Translates a specific text. A language (e.g. English, German, French, etc.) must be added to specify a language to translate to.

Random Image

Random Image Commands: 10

  • achievement Sends an Minecraft achievement with the text you provided.
  • bird: Sends a random image of a bird.
  • bunny: Sends a random image of a bunny.
  • cat: Sends a random image of a cat.
  • dog: Sends a random image of a dog.
  • duck: Sends a random image of a duck.
  • food: Responds with a randomly generated food.
  • image: Sends a random image.
  • image-search: Sends a random image based on your query.
  • lizard: Sends a random image of a lizard.

Random Response

Random Response Commands: 20

  • advice: Get some advice!
  • button: Responds with a random 'Will You Press The Button?' situation.
  • cat-fact: Shows a random fact about cats.
  • shiro-fact: Sends a fact about the bot.
  • dog-fact: Shows a random fact about dogs.
  • fortune: Get a fortune!
  • joke: Tells a general or programming-related joke.
  • kaomoji: Displays a random kaomoji! (´・ω・`) 3000 will definitely be enough to keep you busy! (v`▽´)v
  • loremipsum: Need placeholder text for your website? Look no further.
  • magic8ball: Consults my magic 8-ball!
  • meme: Searches for a random meme from selected subreddits! Warning: There is no NSFW filter on this!
  • never-have-i-ever: Responds with a random 'Never Have I Ever...' statement.
  • number-fact: Responds with a random fact about a specific number.
  • pasta: Cool custom, random pastas that I make!
  • pickupline: Get a random pick up line!
  • quote: Gives you a random quote!
  • rightthere: Sends a random right there copypasta! May include NSFW language and elements or considered as spam.
  • roast: Roasts a user.
  • today: Finds a historical event from today!
  • tsundere: Get a random tsundere quote!

Searches

Searches Commands: 14

  • company: Shows the image and website of the company you provided.
  • define: Defines the word you provided.
  • forecast: Shows the weather forecast for 5 days of the specified city.
  • giphy: Returns a GIF from Giphy based on your query.
  • github: Returns information about the specified GitHub repository.
  • jisho: Searches for Japanese words and kanji on Jisho!
  • nasa: Searches NASA's image archive for your query.
  • osu: Responds with information on an osu! user.
  • steam: Searches Steam for games!
  • urban: Searches the Urban Dictionary for the specified query.
  • weather: Displays weather information for the specified location.
  • wikipedia: Searches Wikipedia for the specified article.
  • xkcd: Searches for a comic on xkcd.
  • youtube: Searches for your query on YouTube!

Text

Text Commands: 14

  • clap: Sends the same message that you had sent, but replaced with clap emojis.
  • cow-say: Sends the same message that you had sent, but with the cow say style.
  • destruct: Sends the same message that you had sent, but it will get auto deleted after a specific amount of time.
  • emojify: Sends the same message that you had sent, but converts it into emoji form.
  • fliptext: Sends the same message that you had sent, but flipped.
  • leet: Sends the same message that you had sent, but as leet text.
  • morsecode: Encodes a given text in Morse Code.
  • piratespeak: Sends the same message that you had sent, but as pirate speak.
  • reverse: Sends the same message that you had sent but reversed.
  • say: Lets me say something for you. Useful for example to create rules or help pages.
  • ship: Combines two or more mentioned user's names.
  • tapcode: Encodes a given text in Tap Code.
  • vaportext: Make text A E S T H E T I C.
  • zalgolize: Sends the same message that you had sent, but zalgolized.

Licensing

For more information view the LICENSE file.

shiro's People

Contributors

buttermiilk avatar peachytree avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.