Code Monkey home page Code Monkey logo

shiro's Introduction

Shiro

Build Status

Shiro is a open-source Discord bot coded in JavaScript with discord.js using the Commando command framework.

ยฉ2017-2021 PeachyTree

Table of Contents

Permissions

Shiro needs several permissions to be able to do what she does. Below is every permission Shiro asks for, and what commands you lose if you don't grant that permission.

  • Create Instant Invite is needed to allow owners to join your server to test if needed.
    • You lose no commands by turning this off, but you might hinder support.
  • View Audit Log is not needed yet, but is something Shiro 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 Shiro to use the say command to delete your message, but the command will still work without it.
  • Embed Links is required to allow commands that send embeds to work. Too many commands to list use it.
  • Attach Files is required to allow commands that send files to work. Too many commands to list use it.
  • Read Message History is required to allow Shiro to react to messages alongside "Add Reactions".
  • Mention @everyone, @here, and All Roles is not needed, but is included as a basic permission.
  • Use External Emojis allows Shiro to use custom emoji in certain commands.
    • While the commands benefit from it, it is not required for the commands to work.
  • Add Reactions allows Shiro to use commands that add reactions to messages in certain commands.
    • While the commands benefit from it, it is not required for the commands to work.
    • "Read Message History" is also required to allow Shiro to react.

Fun Information

  • 500+ commits
  • 150+ commands
  • 21,000+ lines of JavaScript
  • 45,000+ lines of JSON data
  • 4 years of development

Installing

Before You Begin

  1. Make sure you have installed Node.js (you will need at least v15.0.0) and Git.
  2. Clone this repository with git clone https://github.com/PeachyTree/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. Run npm i --production in the folder you cloned the bot.
  2. Run npm i -g pm2 to install PM2.
  3. Run pm2 start Shiro.js --name shiro to run the bot.

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?"
  4. 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.
  5. 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 apt install libtool so sodium can compile if necessary. (Optional)
  5. Run npm i --production in the folder you cloned the bot.
  6. Run npm i -g pm2 to install PM2.
  7. Run pm2 start Shiro.js --name shiro to run the bot.

Filling Out Your .env File

Getting all the API keys for your .env file can be a pain on a bot this big, I know. That's why I've compiled a list here of where to go to get every single API key. Note, not all of these are free.

Discord-related Info

  • SHIRO_TOKEN can be obtained at the Discord Developer Portal.
  • OWNERS is a comma-seperated list of Discord User IDs.
  • SHIRO_PREFIX is the prefix you want the bot to have. Like s?.
  • INVITE is an invite link to a Discord server. The whole thing, not just the code.
  • SHIRO_WEBHOOK_ID is the ID of the webhook you want the webhook command to use.
  • SHIRO_WEBHOOK_TOKEN is the token of the webhook you want the webhook command to use.

API Keys, IDs, and Secrets

Here's where things get LONG. If you're greeted with a log-in page when clicking any of these links, you'll need an account for that API. All are free unless otherwise stated.

Imgur Album IDs

This section is a bit different, as all of these keys are the same process. First, sign up for Imgur. Then, just go to your profile and make albums that contain the images for the command 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: SOON

Full command list coming soon...

Category:

  • command-name: Command Description.

Licensing

The bot is licensed under the GPL 3.0 license. See the file LICENSE for more information. If you plan to use any part of this source code in your own bot, I would be grateful if you would include some form of credit somewhere.

shiro's People

Contributors

buttermiilk avatar peachytree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kurodenjiro

shiro's Issues

Token

Capture
So my token is in a env file
Capture
And it says invalid token it's currently stored like this
CELESTIA_TOKEN=My discords bot token here.
And it doesn't work

Issues

Oh no, an error occurred: fields.flat is not a function.
This is coming in help ,
Pls help.

Wikipedia Error

I got issues on wikipedia when i try to search some query
it's say

Oh no, an error occurred: MessageEmbed is not defined.

Maybe you are forget to add

const { MessageEmbed } = require('discord.js');

Thank you.

Errors!

Whenever i try to perform a commands, it works fine. But when someone else does that command it doesn't works and logs errors on console.
The logs are-

Uncaught Promise Error:  TypeError: Cannot read property 'user' of null
    at Object.check (/home/container/config.js:51:82)
    at Luna.permlevel (/home/container/celestia.js:34:24)
    at module.exports.run (/home/container/events/message.js:41:31)
Uncaught Promise Error:  TypeError: Cannot read property 'user' of null
    at Object.check (/home/container/config.js:51:82)
    at Luna.permlevel (/home/container/celestia.js:34:24)
    at module.exports.run (/home/container/events/message.js:41:31)
Uncaught Promise Error:  TypeError: Cannot read property 'user' of null
    at Object.check (/home/container/config.js:51:82)
    at Luna.permlevel (/home/container/celestis.js:34:24)
    at module.exports.run (/home/container/events/message.js:41:31)

NSFW Commands not working

Please describe the problem you are having in as much detail as possible:
only nsfw command working is ass no other commanss work i just get a 404 error

Further details:

  • Version:

  • Priority this issue should have โ€“ please be realistic and elaborate if possible:

  • I found this issue while self-hosting the bot.

    • Node.js version:
    • Commit hash:
    • Operating system:

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.