Skip to content

PenDZ-Alter/nahida-discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discord-bot

A Basic discord bot with music and AI inside of it
Nahida is just my discord bot's name :)

Getting Started

  1. Open file named .env.example (located in config directory), copy your bot token, client_id, guild_id.

    • The token, you can get from discord developer website in this link, go to application and go to your bot get your token there.
    • The Client ID, you can get it from discord server and copy the ID from your bot.
    • The Guild ID, you can get it from discord server and copy the ID from your server ID. This is optional, if you want to make the bot can used globally, simply don't add it.
    • Don't forget to rename the file from .env.example to .env .
  2. (OPTIONAL) Configure OpenAI Key

    • Copy your API Key from openai and copy to api_key inside file .env (the token, guild, and client that you set in number 1)
    • For more secure, Copy your Role ID into ai_config -> role inside file config.json
    • To make this AI Works, you need Channel ID into ai_config -> channel inside file config.json

NOTE! Make sure you have subscription/billing in OpenAI Platform. Otherwise, this will not work for you! if you want to change the model, see this documentation :
https://platform.openai.com/account/rate-limits

How it Works?

I'm using discord.js, discord-player, and openai packages from npm and running it using node.
The token it'll needed to authenticate your bot into discord API. Also, client ID and guild ID is the identity of your bot user and server user.
Actually, guild ID isn't necessary to adding it. This just make to load slash commands into directed server! But, you really need client ID

How to run it?

  1. Installing Packages
    Use command

    npm i

    and wait until done!
    if there's something error, just ignore it :)

  2. Get the auth token for youtube
    WARNING! When getting the auth token from youtube, please don't use your main account. Because is too risky, and the biggest disaster is your account will get permanently ban.
    You can see the documentation and reason about in :
    https://github.com/retrouser955/discord-player-youtubei/blob/master/LEGAL.md

    Use command

    node getAuth.js

    or you can use

    npx --no discord-player-youtubei

    Copy all cookies data into .env file, inside YT_CREDENTIAL_USER.

  3. Run the bot :)
    Use command

    node .

    Done! :)

NOTE! Remember to always direct directory into bot folder before you do the step!

Notes this branch

WARNING! This branch contain explicit content. Please use this branch wisely
Or, if you don't want it, just disable or set to 0 the nh and pics command in config.json

Having problem to connect API's?
Check this link, maybe help you to solve the problem :)

About

Basic discord bot with music and AI inside of it

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published