Discord Motto
Discord Motto is a simple Node.js module that lets you easily manage custom mottos for your discord bot
- Unlimited servers
- Default motto
- Super fast
- 100% Reliable
- Fast Support
Note: All data is reliably stored in an SQLite database.
Installation
npm i discord-motto
Real Life Example
For use with discord.js
const Discord = require('discord.js');
const client = new Discord.Client();
const prefix = require('discord-motto');
//if the server doesn't have a set motto yet
let defaultMotto = 'Welcome to my server!';
client.on('message' (message) => {
//get the motto for the discord server
let guildMotto = prefix.getPrefix(message.guild.id);
//set motto to the default prefix if there isn't one
if (!guildMotto) guildMotto = defaultMotto;
});
client.login('token');
Methods
setMotto
Set the motto into the database for a server:
const motto = require('discord-motto');
motto.setMotto('motto', 'guild_id');
getMotto
Getting a motto from the database:
const motto = require('discord-motto');
motto.setMotto('motto', 'guild_id');
console.log(prefix.getMotto('guild_id'));
// -> !
setMotto
Setting the default motto
const motto = require('discord-motto')
//Specify no server to change the default motto.
motto.setPrefix('Welcome to my server!');
//Specify no server to get the default motto.
console.log(motto.getMotto());
// -> !
Links
- Docs (coming soon)
- Discord.js Module
- Discord.js Docs
- GitHub
- Support Server
- Node.js