Thread: Basic Discord Bot

Results 1 to 8 of 8
  1. #1 Basic Discord Bot 
    Banned
    Join Date
    Dec 2017
    Posts
    47
    Thanks given
    47
    Thanks received
    30
    Rep Power
    0
    Hello so today I will be releasing a very basic discord bot that will allow you to get the basic bot into your server/program and allow you to run commands

    1) Download [Only registered and activated users can see links. ] that contains all the basic code and has the following in the code base

    • Command Listener
    • Removes command after someone sends (Stop chat filling up)
    • One example command
    • One Lib (JDA-3.5.0_327-withDependencies)


    After you have that download and you have added it to your project go to the next step

    2) Now you have it in your project you will want to make a bot and a key and set up some basic information about the bot find the DiscordConstants Class and you will see the following

    • Prefex - This is what your command is to call the bet I have set it to [::] since that is what is used in steps commands but this can be anything you want
    • Program_Name - This does not need explaining really but it's your Server / Program Name
    • Discord_Bot_Message - This is the message that shows under your bot name as shown here
    • Footer_Icon - This is the icon that will show in the footer of all your messages and it can be a link to any image you like
    • Discord_Token - This is very important as it will link you to your discord server I have linked a tutorial on how to get this [Only registered and activated users can see links. ]


    Now you have all that setup I will show you the code a little and some idea you can add to your bot

    Running the bot:

    In DiscordConnection you will see a method called init go to where your server is initialized and call that method

    Making a new Command:

    if you look in
    Code:
    discord.commands.impl.all
    this is where you will put your commands for an example I have put a simple class called players if you look in the class you will see it implements Command this the the basic structure for the commands and you will see the following methods in it

    • called - If the command has been called
    • action - what you want the command to do
    • executed - If you need the command to do anything once it's been running eg clean up of some sorts / stop a timer
    • description - WHat the command does (I will explain this more soon)


    Once you have your new command done you will need to go into DiscordConnection
    and look for addCommands under it add

    Code:
    CommandHandler.COMMAND_MAP.put("players", new Players());
    the first parameter is what the user uses to call the command this can be any string
    the Second parameter is the class name of the command that you want to run

    now I have explained all of that and you have a basic understanding of the system here are some things I have done and you may want to look at yourself

    • Add permissions to the bot and check if they are correct on the discord bot this is why I packaged my commands as .all
      I also have on my server .owner .admin and then them commands can only be run if you meet that rank
    • I have a description method so if a player does ::help you can send them a pm with all the discord commands and a description
    • Music Bot
    • Search your wiki
    • Get Server stats
    • Lookup Players
    • Announcements when someone gets a special drop or max etc
    • Server Announcements for events
    • Link server account to discord so it mentions you instead of just saying your name


    You can do a lot.

    Before anyone says Easy or whatever bullshit you wish to say I did this so people did not have to buy basic bots when there are lots of tutorials on it and its really simple, if you need any help feel free to post
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    The Jedi Council


    Join Date
    Dec 2014
    Posts
    540
    Thanks given
    175
    Thanks received
    128
    Rep Power
    164
    Thanks going to try this out
    [IMG][/IMG]



    "Not everyhing that counts can be counted
    and not everything that's counted truly counts."
    Reply With Quote  
     

  4. Thankful user:


  5. #3  
    Registered Member
    Join Date
    Feb 2013
    Posts
    112
    Thanks given
    35
    Thanks received
    8
    Rep Power
    0
    Cool, thanks for posting this, it will be fun making some new commands for it
    Reply With Quote  
     

  6. Thankful user:


  7. #4  
    Registered Member
    vvaved's Avatar
    Join Date
    Sep 2017
    Posts
    247
    Thanks given
    87
    Thanks received
    61
    Rep Power
    116
    Thanks mate

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. Thankful user:


  9. #5  
    Banned
    Join Date
    Dec 2017
    Posts
    47
    Thanks given
    47
    Thanks received
    30
    Rep Power
    0
    Quote Originally Posted by milan View Post
    Thanks going to try this out
    You're Welcome

    Quote Originally Posted by Dylcity View Post
    Cool, thanks for posting this, it will be fun making some new commands for it
    You're Welcome, You can make some super cool commands maybe post some in the thread for other people ill add into the main thread

    Quote Originally Posted by Vizions View Post
    Thanks mate
    You're Welcome
    Reply With Quote  
     

  10. #6  
    The Jedi Council


    Join Date
    Dec 2014
    Posts
    540
    Thanks given
    175
    Thanks received
    128
    Rep Power
    164
    This link to replace your client id seems so be broken?

    [Only registered and activated users can see links. ]
    [IMG][/IMG]



    "Not everyhing that counts can be counted
    and not everything that's counted truly counts."
    Reply With Quote  
     

  11. #7  
    Server developer


    Join Date
    Jul 2010
    Posts
    880
    Thanks given
    265
    Thanks received
    55
    Rep Power
    94
    Quote Originally Posted by _Naitsirhc View Post
    You're Welcome



    You're Welcome, You can make some super cool commands maybe post some in the thread for other people ill add into the main thread



    You're Welcome

    It feels like the listeners aren't working. When I type a command in my discord nothing happens and the bot is offline.


    I am the one who knocks
    - - - - -

    Reply With Quote  
     

  12. #8  
    Banned
    Join Date
    Dec 2017
    Posts
    47
    Thanks given
    47
    Thanks received
    30
    Rep Power
    0
    Quote Originally Posted by klaasvaakjes View Post
    It feels like the listeners aren't working. When I type a command in my discord nothing happens and the bot is offline.
    did you add the right Token because and make sure you are running the bot it 100% works
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. 876 nocturne Discord bot setup need help
    By Castiel in forum Help
    Replies: 3
    Last Post: 03-14-2018, 03:53 PM
  2. Buying discord bot
    By Saim in forum Buying
    Replies: 1
    Last Post: 11-15-2017, 05:28 PM
  3. Custom discord bots [previous work]
    By Phoenix in forum Selling
    Replies: 8
    Last Post: 06-07-2017, 07:05 PM
  4. Add a Discord Bot to your server!
    By Cody_ in forum Tutorials
    Replies: 5
    Last Post: 01-21-2017, 12:50 AM
  5. Basic IRC bot
    By atrox_ in forum Application Development
    Replies: 0
    Last Post: 12-31-2008, 01:01 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •