Giter VIP home page Giter VIP logo

c3duan / swag-bot Goto Github PK

View Code? Open in Web Editor NEW
110.0 11.0 62.0 31.34 MB

My first ever discord bot using discord.js. The bot has a total of 77 commands, and it is capable of manipulating texts and images, analyzing data, searching information, and playing music. It has high level features like xp system, coins database, and spam detector.

License: Other

JavaScript 100.00%
discord-bot discord-js node-js restful-api javascript es6-javascript discord-api mysql-database mongodb-database

swag-bot's Introduction

Swag-Bot

Discord Server Build With Dependencies

Info

  • My first ever discord bot using discord.js, it has a total of 70 powerful commands along with a versatile xp database for the server.
  • Join my Server
  • Invite my Swag-Bot

Features

  • 77 Commands in total
  • SQL and MongoDB databases
  • Built-in Anti-spam module with punishments
  • Color Roles

Frameworks & Libraries

  • Discord.js

APIs

  • riot api
  • fortnite api
  • weather.com api
  • youtube api
  • dog api
  • dog facts api
  • cat api
  • cat facts api
  • yandex api

Example Config.json

You need to personalize your own config with the following information:

  • your own bot command prefix
  • your discord bot token
  • various api keys
  • databse host, user & password
{
  "prefix": "!",
  "token", "my-token",
  "swag-api-key": "my-swag-api-key",
  "swag-api-region": "Duanism",
  "swag-api-version": "2.2.7",
  "dog-api": "bark-bark",
  "cat-api": "meow-meow"
}

Command Trigger Prefix: !

List of Commands

  • essentials
    • help - provides usage and description of a particular command
    • invite - gives an invite link of Swag
    • kick - kicks an tagged member out of the server
    • ban - bans an tagged member from the server
    • mute - mute an tagged member for a specific time
    • unmute - unmute an tagged member
    • prune - delete an certain number of messages
    • role - gives info regarding a specific role
    • channel - gives info regarding a specific channel
    • server - gives info regarding the server
    • user-info - gives info regarding a specific user
    • args-info - gives info regarding the arguments entered by the user
    • react-custom - custom reaction
    • avatar - shows the link of a user's avatar
    • beep - responds with boop
    • ping - responds with pong
    • poll - a strawpoll that shows the resulting votes
  • humor
    • meme - allow the user to make a custom meme
    • random-meme - generates a random meme
    • gif - generates a random meme with a specific category
    • insult - insults an user in a fancy way
    • momma - tells a random yo momma joke
    • joke - tells a random joke about someone
  • gaming stats
    • Fortnite Tracker - provides stats of a fortnite player
    • League of Legends
      • lol-summoner - gives account info of a specific summoner
      • lol-rank - shows the solo and flex ranks of a summoner
      • lol-champion - gives detailed info of a specific champion
      • lol-tips - gives tips regarding playing as or against a specific champion
      • lol-ability - gives info about an ability of a champion
      • lol-skin - shows all skins of a champion
      • lol-match - shows the past 5 match of a summoner (filter by match type)
      • lol-item - shows info about a particular game item
  • info search
    • kitsu-anime - gives info about a particular anime
    • kitsu-manga - gives info about a particular manga
    • today-in-history - gives info about what happened on that date in history
    • nba-player - gives player info and stats of a particular active NBA player
    • fifa-player - gives player info and FIFA ratings of a particular FIFA player (2018)
  • miscellaneous
    • advice - gives a random life advice
    • weather - provides weather forecast of a specific location
    • zodiac - determines the user's zodiac based on his or her birthday
    • colors - show all the colors avaliable in the server
    • color - get one of the colors
    • logan - a welcome message for my special friend (Logan Suarez)
  • animal related
    • dog - generates a random image of a cute dog
    • dog facts - provides a random fun fact about dogs
    • cat - generates a random image of a cute cat
    • cat facts - provides a random fun fact about cats
  • games
    • 8ball - magic 8 ball game
    • diceroll - dice roll with your choice of number range
    • coinflip - flip a coin
    • gamble - gamble your coins for some extra or lose all of it
    • hangman - hangman fun word guessing game
    • quiz - a random quiz with different difficulties and formats
  • music
    • play - play a youtube song or video
    • skip - skip the current song or video
    • pause - pause the current song or video
    • resume - resume playing the current song or video
    • queue - shows the current playlist queue of the guild
    • volume - adjust the volume of the current song or video
  • numbers
    • currency conversion - convert a base currency to a target currency
    • grade calculator - calculate what you need to score on your next assignment/assessment in order to achieve the target grade you want
    • unit conversion - convert a base unit to a target unit
  • words
    • urban - provides the urban dictionary definition of a specified word
    • random-urban - provides the urban dictionary definition of a random word
    • translate - translates text from one language into another language

XP/Coins DataBase System

  • xp - check your current xp amount and level
  • coins - check your total coins
  • xp-leader - shows a top 10 leaderboard of total xp
  • coins-leader - shows a top 10 leaderboard of total coins
  • market - server market that provides special roles and additional xp for purchase by coins
  • pay - pay someone a specific amount of coins
  • buy - buy a speical role or a specific amount of xp from the market

Issues

  • problemng with resuming song or video
  • spam detector triggers on false cases

Special Thanks / Resources / Credits

swag-bot's People

Contributors

c3duan avatar dependabot[bot] avatar stackneverflow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swag-bot's Issues

lol-item API call giving undefined status code

kayn.DDragon.Item .list() .version(config.riot_api_version) .callback((error, list) => { if (error) { console.error(error); return message.reply('sorry an api error occurred, please try again.'); }

            const items = list.data;
            const item = Object.entries(items).find(weapon => weapon.name.toLowerCase() === itemName);
            if (!item) {
                return message.reply('sorry no such item exists, please try again.');
            }
            const embed = new Discord.RichEmbed()
                .setTitle(item.name)
                .setDescription(item.description.replace(/\s*\<.*?\>\s*/g, ''))
                .setThumbnail(`http://ddragon.leagueoflegends.com/cdn/${config.riot_api_version}/img/item/${item.image.full}`)
                .addField(`${item.plaintext} into ${item.into.join('/')}`)
                .addField('Purchase Price', item.gold.total, true)
                .addField('Sell Price', item.gold.sell, true);
                
            message.channel.reply(embed);
        });`

{ statusCode: undefined, url: 'https://ddragon.leagueoflegends.com/cdn/8.18.2/data/en_US/item.json', error: TypeError: Cannot read property 'statusCode' of null at kayn.DDragon.Item.list.version.callback }

i can figure this :(

Music Bot not playing he is keeping say
added to queue: Tyga - Ayy Macarena (Official Video)

Resume not working

Voice Channel remains silent after resuming the music playing, [potential problem with my resume command and resumeSong() function in music.js].

Possible Fixes:

  1. Instead of using dispatcher.resume() built-in function, use my own playMusic() function in music.js
  2. Possible bug in pause command despite stopping the music playing

Modular Refactor

I can clean up index.js by spreading your functions / events across multiple files and folders. For e.g. ready.js message.js could be in a folder called Events. I also noticed your not using dotenv which could make handling secrets more convenient. Let me know if you want this and I'll get started when I have time.

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.