TechMaking your own Discord Bot: Discord Bot Maker

Making your own Discord Bot: Discord Bot Maker

-

- Advertisment -spot_img

Making your own Discord Bot: Discord Bot Maker

The Discord Bot Maker is one of the best ways to make Discord bots on the discord website. This feature provides users with more functionality than the user already has. It also features a service that allows its users to create or code their own bot and make it do whatever is commanded of it. There is a lot of stuff you can use the Discord bots for. Read more to get extra information about this service.

Making your own Discord Bot
Making your own Discord Bot

Discord Bot Maker

Like I said earlier, there are several utilities that the bot can serve as. Among every other bot maker, Discord is proven to be one of the best for users to access. There are a lot of useful functionalities to make coding your bot seem easy and non-time consuming. A discord Bot can serve and operate as any of the following:

  • An automated chatbot that behaves just like humans
  • Moderation bot useful for automatically moderating your server, kicking, muting, or banning spam members
  • Music bot
  • Can be used to manage servers via bot commands
  • Play music directly from Discord
  • Used for controlling the level of spam in your platform
  • View information about your server

And a lot more other amazing features you wouldn’t want to miss out on. Get into the platform today and get its services useful. Of course, I am, going to show you how to create your own bot on discord

Discord Servers

Using Discord isn’t just operated on the website www.discord.com. Users can as well access this platform as a mobile app available to both iOS and Android devices. Here is how to download the Discord Bot Maker on your mobile device:

  • Launch your app store.
  • Search for Discord.
  • Scroll and tap on the “Discord” app.
  • Download or Get the app.

Wait for a while for the app to be installed to your device. Now you can begin tot enjoy the Discord Bot Maker app on your mobile too.

How to Make A Discord Bot

Before creating a bot, you will need some public knowledge of PHP, a neighborhood server to operate your code (like Wamp) and basic knowledge of composer. This will require user to get the composer installed on their pc.

Step 1:

Create a folder in your wamp www folder.

Run the cmd command from windows and kind something like this to succeed in the discord folder that you just created.

Cd c:\

Cd wamp64

Cd www

Cd discord

Then run:

composer require team-reflex/discord-php

Step 2:

Create a run.php page and put it within the root folder of your discord folder, from wamp. Write some code, something basic like this:

<?php

include __DIR__.’/vendor/autoload.php’;

use Discord\DiscordCommandClient;

$discord = new DiscordCommandClient([

  ‘token’ => ‘add your bot token here’,

]);

$discord->on(‘ready’, function ($discord) {

    echo “Bot is ready.”, PHP_EOL;

    // Listen for events here

    $discord->on(‘message’, function ($message) {

        echo “Recieved a message from {$message->author->username}: {$message->content}”, PHP_EOL;

 }); //end small function with content

}); //end main function ready

$discord->run();

?>

Step 3:

Head to this page and register your application (bot).

https://discordapp.com/developers/applications/. Give your bot a reputation, move to the bot tab, and take the token, paste it into your run.php page.

Step 4:

Invite the bot into your channel.

Paste this URL within the browser: https://discordapp.com/oauth2/authorize?client_id=CLIENTID&scope=bot. You will get the client id from https://discordapp.com/developers/applications/. Then you will see the client id on the most page. Replace it within the URL and paste it.

You can invite the bot only on the channels that you just are admin.

Step 5:

Run the bot from your cmd console.

Pull cmd, visit the proper path where the discord folder is and sort “php run.php”.

You will see the bot beginning and going surfing on discord, on your channel. After that, you’ll start to feature some more code within the run.php file. Here is an example with some basic stuff. Replying to the user and also storing all the chat messages in an exceedingly html file.

<?php

include __DIR__.’/vendor/autoload.php’;

use Discord\DiscordCommandClient;

$discord = new DiscordCommandClient([

  ‘token’ => ‘your token goes here’,

]);

$discord->on(‘ready’, function ($discord) {

    echo “Bot is ready.”, PHP_EOL;

    // Listen for events here

    $discord->on(‘message’, function ($message) {

        echo “Recieved a message from {$message->author->username}: {$message->content}”, PHP_EOL;

//I have named my bot Hall 9000, name yours as you like

 if ($message->author->username !== “Hall 9000”){

          //$message->reply(“HI!”);

 }

if (preg_match(‘/ping/’, $message->content)){

          $message->reply(“pong”);

}

if ($message->content == ‘!info’){

          $message->reply(“Here is some info!”);

}

if ($message->content == ‘!age’){

          $message->reply(“I am one day old!”);

}

//this will close the bot

if ($message->content == ‘!exit’){

          $discord->close();

}

//gets the weather in my city

$url = ‘http://rogeek.com/arhiva-vremea-meteo/locatie-galati.php’;

$get_content = file_get_contents($url);

preg_match_all(‘/Temperatura: [0-9] grade celsius/’, $get_content, $matches);

if ($message->content == ‘!weather’){

          $message->reply($matches[0][0]);

}

//if I write anything on the channel

if ($message->author->username == ‘rgCristi’){

          $message->reply(“chin up my dude!”);

}

//writes data in a html file, the chat content, acts as a log

date_default_timezone_set(‘Europe/Bucharest’);

$current_date = date(‘m.d.Y G:i:s’);

$file = ‘chat-log.html’;

// Open the file to get existing content

$current = file_get_contents($file);

// Append a new person to the file

$current .= $current_date. ‘ ‘ .$message->author->username.’: ‘.$message->content.PHP_EOL;

// Write the contents back to the file

file_put_contents($file, $current);

}); //end small function with content

}); //end main function ready

$discord->run();

?>

The last idea, you’ll add some PHP code to upload the log file on a server and have it all the time on a website.

Bot Designer For Discord

There is an app called both designer on discord that you can actually use in creating your discord bot without programming knowledge.

The bot designer is a free-to-use tool and it is capable of creating all kinds of bots easily if you want to start bot creation. This app has a way of teaching you and taking you from easy command creator to advanced javascript command.

To download this app visit the Play store link or the App store to get the app.

Remember there are several activities that can be commanded from your created bot. so ensure to run a specific operation for your bot. Ensure not to miss out on any steps on this Discord Bot Maker article.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest news

Best Instant Pot 2021 – The 8 Best Instant Pots in 2021

"Best Instant Pot 2021" Are you searching for the best instant pot in 2021? The best Instant Pot can...

Best Robot Vacuum 2021 – Best Robotic Vacuums of 2021

Are you searching for the best robot vacuum 2021? No need to pull your upright vacuum, broom, and dustbin...

Samsung Galaxy S22: Rumors, Specs, Pricing, Release Date

Have you heard that Samsung Galaxy S22 is Samsungs next flagship? The release of the Samsung Galaxy S22 is...

How to Use Facetime on Android with Ios 15

Are you searching for how to use facetime on android with iOS 15? Do you want to know how...
- Advertisement -

Facebook is Reportedly Planning on Changing its Name

An unidentified source with direct knowledge of the matter On this matter has confirmed that Facebook is planning on...

Halloween Cover Photos for Facebook

"Halloween Cover Photos for Facebook" Are you looking for how you can get Cover Photos for Facebook? Are you...

Must read

Best Instant Pot 2021 – The 8 Best Instant Pots in 2021

"Best Instant Pot 2021" Are you searching for the...

Best Robot Vacuum 2021 – Best Robotic Vacuums of 2021

Are you searching for the best robot vacuum 2021?...
- Advertisement -

You might also likeRELATED
Recommended to you