#development
1 messages · Page 457 of 1
what
hi how do i do a report cammand
The bot never received the ready event before restarting
i need it so ppl can report other ppl and it will send it to me
or an admin
Just think of it logically of how it would work and code it.
Discord needs a lightbulb emoji for these moments

lol
turtle.music add https://youtu.be/dsPhQwejL0U
Follow our Spotify playlist: http://trapcity.tv/Spotify Subscribe here: http://trapcity.tv/subscribe Download here: https://www.hive.co/downloads/download/50...
turtle.stats
.set prefix turtle.
wtf

I remember tonkku had an aswer to that in #general, it's something related to css
or was it tonkku 
now I'm thinking it was auxim, or aly, idk anymore ¯_(ツ)_/¯
how long ago
Ok I want to add some NSFW commands to my bot, but I don't know of any good apis to use, any suggestions?
Once I get the API, I can do the rest lol
@ruby dust
how long ago
with?
@earnest phoenix srry for the late reaction im playing a game so didnt see the mention
this is the error message when I type :
node mybot.js
in CLI:
https://gyazo.com/2283058636f4c4814c2bca6c40f65c02
anyone got any ideas on how to fix this?
that's the folder contents
const client = new Discord.Client();
client.on("ready", () => {
console.log("I am ready!");
});
client.on("message", (message) => {
if (message.content.startsWith("ping")) {
message.channel.send("pong!");
}
});
client.login("supersecretid");```
just a note, I did replace "supersecretid" with the token, with quotes
is it supposed to be no quotes?
quotes/strings
oof, just a sec
its supposed to be like that
^
SyntaxError: Invalid or unexpected token
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
PS C:\Users\gah\Documents\EXP Bot>```
i dont see any problem 
the bot is still offline though?
What do I do when I'm in this discord and says I still need to be in it
where @flat kite
Nvm
OK
Ok I want to add some NSFW commands to my bot, but I don't know of any good apis to use, any suggestions?
@ripe crown ^^
How do you even make one
make one what
A bot
with code
Oh so u cant really make it on mobile
no not really
most of them nah
some might do it at a cost
its better to just code it yourself cuz you and only you know what you want
and its free*
- = hosting on your computer and not a dedicated host because hosting can cost money unless you somehow get a free host like glitch or heroku
sad
@vernal basin you have an invisible character code 8203 on line 3
Unicode Character 'ZERO WIDTH SPACE' (U+200B)
how does one get a zero width space in their code
no idea, probably coding on notepad
his "mybot" file has the default icon, not associated with any editor
probably notepad
yea ur right
get a editor please its better
also enable file name extensions i recommend
^

Is there a bot that could let you chat as a different name?
visual studio code, sublime text etc.
Be as your name then like chat under another persons name in the server

you can make the bot repeat what you said
but thats that
you can talk through the bot if you're the owner, but that against TOS i believe
webhooks 
im trying to log the warn and kick command to a certain channel, im using client.channels.get("member-log").send("message") but it gives me ReferenceError: client is not defined
then client is not defined
^
what do you have defined as new Discord.Client()
i figured that but how do i define it
^
ok thank yiou
oh wait nothing in the command fil;e
in my index file i have it defined as client
if you're using module exports, i believe you need to redefine it in every file
oh ok thank you
do i need to define it as anything diffrent or still new Discord.client()
i dont use module exports so idk
it should be exactly the same as you define it in your main file
i guess
it should
thank you
thing is i dont use module.exports like that but exports.run where run is a function that basically has the command's code
but you still need to redefine everything?
yes
rip
yes i know
i have one main file which contains all the command functions, then i have a couple other files that contain the heavy logic of the function
and i load them using eval
xD
so in main file it would be like this to run the command
const cmd = require(`./cmds/${command}.js`)
cmd.run(bot, msg, args, config)
then in the command file
exports.run = (bot, msg) => { // blah }
so i added const client = new Discord.client but it said discord is not defined, so i added const Discord = require('discord.js'); but now its giving me Discord.client is not a constructor
so yea
what you mean
ah
just replace the string with the emoji codes for the regional indicators
or simply copy the unicode character
but what would i do for my error mentioned above?
code is case-sensitive so its Client not client
o thanks
idk how i missed that
but now on the line client.channels.get("member-log").send("test") its giving me cannot read property 'send' of undefined (sorry if im being a bother)
.get() uses ids
oh is there something that uses channel names?
thanks
im so sorry that im asking for more help but on the same line which is now client.channels.find(c => c.name === "member-log").send("test") is giving me cannot read property send of null
oh thanks
thank you so much! ive been having trouble with this for several days and it finally works
np :D
where is the extra space coming from?
btw
just search theme in the extensions tab
oh cool
@vernal basin your error says its on line 3
lets try again, I deleted line 3 completely
dang, again
line 6 this time
ah I get it
I can't have random [Enters] in the code
YES
it worked
thanks 😄
onto step 2
that happens when you copy and paste code sometimes
on websites with like codeblocks
ah, that would explain it
yeah some websites encode special characters in weird ways
i need some help coming up with functioning song queue
i have almost everything i need i just need a way to continuously check if the current song is finished playing
There's an after call you can set when you start playing the song
How can I edit the Vote button with CSS? 🤔
use the dev tools, inspect element, see the css structure and how to target it
@abstract perch What library do you use?
{
"token": "mytoken";
"prefix": "exp!";
}
so the config guide tutorial told me to do this, except the compiler keeps saying there's a problem with using a colon and that it expects a semicolon
fixed, nvm
Discord.js but why are you asking? @vernal crow
Cause of what you put in general
One sec. Gotta drive. But I’ll help you with the welcome message.
can someone help me
ye token was cool
you should reset it in case someone stole it lol
👀
i reset it :v
tim took the token and now will download illegal stuff with that token
Lol


laughs/cries
lmao
lul
@vernal crow You have not understand. They are tons of bots that logs when a user join the server. My bot works fine, but I have to setup the command to send it there #265156361791209475
-welcomeset {channel}
if only admins/mods can use that command, then change it so you can also use it
or ask a mod to use the command for you lol
Ohhh yes
whats the function to unban on discordjs, on the docs it says its guild.unban but when i try that the function doesn't exist
ah thanks
bot.player = await bot.voice.create_ytdl_player("https://www.youtube.com/{}".format(url),after=lambda: play_next(ctx,args))
so this doesnt seem to be working for me
def play_next(ctx, args): coro = play_music.invoke(ctx,args) fut = discord.compat.run_coroutine_threadsafe(coro, bot.loop)
it doesnt go past the first line
@abstract perch Okay, I see what you’re saying.
Nah, my bot got muted for a command that I made for fun without a prefix
And I thought that my bot it wasn’t here
But I have already fixed it like 3 months ago.
how does one make a type of database where you store information of a player and such, and how would you access it when a user prints a command such as !mypoints, where their points are stored, etc.
you don't really "make" one. there are local databases that are easy to use like lowdb, sqlite and leveldb, then when you need really scalable and bigger access, then you get mysql, mongo, rethink, etc
just got to choose what is best for you
cool, thanks
my favorite database for simple projects is google sheets
could you teach me how to read in google sheets o.o
hilarious. and np @vernal basin. i myself use rethink for everything since i'm an addict
and pls no
google sheets isn't a database
oh
no it really has all the functionality you need if you aren't doing complicated joins and stuff
there is no reason to knock it unless you are a grognard
we aren't making banking software here
how does one write/read in databases
D: sorry I'm bad
how tf do you even use it
thats what im saying its perfect for beginners because you can see it in action
LOL is this a joke
there is an api
ikr @earnest phoenix
#memes-and-media please
this is about development
so if i make a function like this
const thing = async () => {
return 'hi';
}
can i use it like this?
thing().then(hi => console.log(hi));
// 'hi'
yes
okie dokes
you shouldn't use async function without await tho since there is no reason to make it async
so self.audio_player = self.bot.loop.create_task(self.audio_player_task()) was on this github for music but it doesnt seem to work
and i have no idea where audio_player_task() comes from
kk
little issue here:
(node:10221) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'url' of undefined
at Object.handler (/home/tony/musicbot/commands/play.js:45:65)
at commands.get.push.then.results (/home/tony/musicbot/commands/play.js:99:18)
// play.js, line 44/45/46:
dispatcher =
queue.connection.play(ytdl(music[msg.guild.id].songs[0].url, { quality: 'highestaudio', filter: 'audioonly' }), { passes: 4 });
// play.js, line 98/99/100:
commands.get('play')
.handler(msg, music[msg.guild.id]);
});
i think its the fact that its not getting enough time to run this code, which fetches the video details:
push: async (msg, args, queue) => {
YouTube.searchVideos(args.join(' '), 2)
.then(async res => {
YouTube.getVideoByID(res[0].id)
.then(async results => {
const res = {
title: results.title,
id: results.id,
url: `https://www.youtube.com/watch?v=${results.id}`,
description: results.description,
addedBy: msg.author,
length: results.durationSeconds,
thumbnail: results.thumbnails.high.url,
channel: results.channel.channelTitle,
publishedAt: results.publishedAt
};
queue.songs.push(res);
return res;
}).catch(console.error);
}).catch(console.error);
},
its very annoying :V
Does anybody here use GPU.js or something similar to speed up their bots?
I haven't looked into this much so I'm not sure if JIMP would work on it
"gpu.js is a single-file JavaScript library for GPGPU in the browser"
also running code on gpus != performance boost
moving data between main memory and gpu memory is expensive
and unless you're doing massive amounts of simple calculations, there's no real benefit
how does one detect if a new user joins the server?
the guildMemberAdd event
thx
is there a way to wait a set amount of time in javascript (sorry if this is a dumb question)
Not really
Not like the time.sleep() function from python
You can however set use setTimeout() I think
ytdl_options (dict) – A dictionary of options to pass into the YoutubeDL instance. See the documentation for more details. where can i find documentation for this
the link is broken
Which you can use to call a function to execute after the timeout
@worldly sigil ytdl docs in python are extremely shitty
If it's for a music bot I'd not look into ytdl
I mean personally when I tried to use it I could get it to work but it would load tracks insanely slowly
And nobody is going to wait 30 seconds for a music bot
whats the other way to do it
I use Lavalink with lavalink.py
Essentially Lavalink is a seperate program that loads the tracks and plays them for you through Discord
It more or less takes over all of the music functions, skips, volume, queue, search etc
it looks a lot easier
you'll need to use Lavalink with Java 10 btw
Java 8 & 9 gave me issues
i need to use java too huh

if you do something like this while not ytplayer.is_done(): await asyncio.sleep(1) await my_bot.voice.disconnect() you wont be able to run any other commands until its done right
Doesn't seem like a good idea to me
if i tell my bot to say something in a specific channel and that channel does not exist on that server, would it crash my bot?
Most likely an error
guild.channels.has()
and is that channel name or id?
Pretty sure it is id.
thanks
Because ids are unique.
umm is there a way toi check for channel name?
guilds.channels.find()
tahnk you
And just find the one using the name property
my bot has like 300+ servers but I wanna give up and stop working on it, should I still continue with it?
Your call :^)
so i want to continue it but dont want to
Probably upload the code on GitHub and let users know about it /shrug
yea oof
@golden sparrow what i'd do is keep it running
but tell users it won't be updated
then maybe discontinue it after a year
alot
@earnest phoenix ask your question instead of asking to ask
Lol
one sec
aaaaa
python me
brb
how do i make my bot support
itunes
my music bot
a friend gave me this which it does support a soundcloud
which i didnt have
whats the thing called where i can share my code at
cause its over 2000char
cant i make the bot search from youtube
yes
tell them its legally impossible
end of story
also tell them that the itunes program exists
alright thanks
np
hello i need some help with #312614469819826177
does anyone have some spare time to help me?
what language + lib?
discord.py async
oof
@next zealot those examples are outdated, use the official dbl python lib
https://discordbots.org/api/docs#pylib
https://dblpy.readthedocs.io/en/v0.1.6/api.html
https://github.com/DiscordBotList/DBL-Python-Library
DBL-Python-Library - A simple API wrapper for discordbots.org written in Python
yo
const Discord = require('discord.js'); const client = new Discord.Client(); client.on("ready", async => { setInterval(function(){ client.channels.find('id', '435814918651117579').setName("♡A"); client.channels.find('id', '435814918651117579').setName("♡An"); client.channels.find('id', '435814918651117579').setName("♡Anime"); client.channels.find('id', '435814918651117579').setName("♡Anime G"); client.channels.find('id', '435814918651117579').setName("♡Anime Ga"); client.channels.find('id', '435814918651117579').setName("♡Anime Gam"); client.channels.find('id', '435814918651117579').setName("♡Anime Game"); client.channels.find('id', '435814918651117579').setName("♡Anime Gamer"); client.channels.find('id', '435814918651117579').setName("♡Anime Gamers♡");}, 10500); }); client.login("NDczODA2MDk5MzY4Mzc4Mzg4XAL8gFIEpjg9dbdRSE4DU");
i heard this is breaks discord tos?
is that true?
btw u know that will set the name 8 times at once so nobody will be able to see it
and that is pretty close to api abuse
@earnest phoenix Id add set interval so that you can actually see the first second and third etc. Also it would make it happen slowly so it wouldn't be as bad api abuse
Tbh it's probs fine if there is a interval because rainbow roles does it
rainbow roles are against the ToS as well
@short siren i need help cause i dont know js
Iv seen loads of bots do it
there's loads of bots that breaks the ToS indeed
You could setTimeout
idk how
For say 2000 that's 2 seconds
i cant code js
Google setTimeout
where
so like
const Discord = require('discord.js'); const client = new Discord.Client(); client.on("ready", async => { setInterval(function(){ setTimeout(function(){ alert("H"); }, 3000); setTimeout(function(){ alert("He"); }, 3000); setTimeout(function(){ alert("Hel"); }, 3000); setTimeout(function(){ alert("Hell"); }, 3000); client.login("NDczODA2MDk5MzY4Mzc4Mzg4XAL8gFIEpjg9dbdRSE4DU");
@short siren like this
Also I wouldn't send your token if I were you
i took off 7 letters
Oh ok
so can i get help?
I'm not going to
but if I were you I'd focus on firstly getting one message to edit after 3 seconds first
this is for private use
So?
just letting you know
can i get some help with this, i am using discord.py async, no cogs
function myFunction() {
myVar = setTimeout(alertFunc, 3000);
}
function alertFunc() {
alert("Hello!");
}
now
how can i make it edit
You can't use s function before you say it
so? how?
Just Google it
yes
also #topgg-api would be better
myVar = setTimeout(alertFunc, 3000);
function myFunction() {
function alertFunc() {
alert("Hello!");
}
like this
const Discord = require('discord.js'); const client = new Discord.Client(); client.on("ready", async => { setInterval(function(){ client.channels.find('id', '435814918651117579').setName("♡A"); client.channels.find('id', '435814918651117579').setName("♡An"); client.channels.find('id', '435814918651117579').setName("♡Anime"); client.channels.find('id', '435814918651117579').setName("♡Anime G"); client.channels.find('id', '435814918651117579').setName("♡Anime Ga"); client.channels.find('id', '435814918651117579').setName("♡Anime Gam"); client.channels.find('id', '435814918651117579').setName("♡Anime Game"); client.channels.find('id', '435814918651117579').setName("♡Anime Gamer"); client.channels.find('id', '435814918651117579').setName("♡Anime Gamers♡");}, 10500); }); client.login("NDczODA2MDk5MzY4Mzc4Mzg4XAL8gFIEpjg9dbdRSE4DU");
whats the number on the buttom?
The 10500
yea
how long of what?
How long till it changes
oh so rechange?
did you even write that code 🤔 obviously you dont understand it
who did then
a friend who got it from a friend who got it from a friend who got it from someone who gave it to me
Umm
did you just leak your token
i think he did
he said he took part of it out
idk looks like it
which part tho
is that the beginning or the end
looks like some from the middle
nah its most of the beginning and then a bit of the end
that might be a full id
and then a bit of the end
but theres no dots so
that's what leads me to believe its a bit of the end
Is this thing editable? https://big.animetitti.es/i/DmV0YZJ.png If yes, then how? 
pretty sure it is
psure everything is editable
Or is it just body affecting that
nah
Oh, aight
Yep, it is. I was using color instead of background for whatever reasons and got lost 😄
hi can someone help me
let guild = client.guilds.find('what gose here');
let channel = guild.channels.find(`id`, 'what gose here');
if (message.author.id == loggedIn.pref.join(' ')) {
let msg = args.join(' ');
channel.send(msg);
} else {
message.reply(`:warning: You are not logged in!`);```
logged in to what
oh i have made it so you need to login to use the command
so on my discord server you do prefix-console login < this will log you it to the bot to you can use the owner only commands
boy i dont know that to put in to let guild = client.guilds.find('what gose here');
and let channel = guild.channels.find(id, 'what gose here');
in the find one, you put in a function that returns true if it's what you want
client.guilds.find(guild => guild.name == 'Discord Bot List');
for example
or as you have this alternate syntax
guild.channels.find('id', '264445053596991498');
is the same as
guild.channels.find(channel => channel.id == '264445053596991498');
is the say command going to send something to a specific channel
and you know the ID of that channel?
you can directly use client.channels
and the get function
client.channels.get(id)
?
for example const development = client.channels.get('272764566411149314')
that would set development to this channel
then you could development.send('help me')
and the bot would send "help me" to this channel
Also just look at the discord js docs
It shows everything
that did not work @bitter sundial
what's the code right now
back to how i had it
like the original code block?
I don't
im as some ppl will call retarted
let guild = client.guilds.find('ID');
let channel = guild.channels.find(`id`, 'ID');
if (message.author.id == loggedIn.pref.join(' ')) {
let msg = args.join(' ');
channel.send(msg);
} else {
message.reply(`:warning: You are not logged in!`);
}```
this is home made all i need to know what i need to put in let guild = client.guilds.find('ID'); and let channel = guild.channels.find(`id`, 'ID');
you don't need the let guild line
what do you need
also do not find with ID, since the collection is mapped by ID just use .get
ok
do i need to put an ID in to the spot where i have put ID or do i leave it blank with a space in it
@earnest phoenix you put an id there
@earnest phoenix you can see o nthe d.js docs that "Collection extends Map"
Since collection doesnt have its own get method, it must take it from Map, so you look up Map on MDN or something and look for the get method to see what parameters it needs
what id my channel id or ?
yes
also i host my bot off glitch.com how to i make a restart thing

glitch restarts whenever you type code
Because I have no idea how xd
the say is still not working
im just going to leave it for now
i will bother you agin if needed
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa < sorry for all the a's but i have tryed every thing i know
and i still cant get it to work
what's your problem
lol
this ```if (choice == "say") {
let guild = client.guilds.find('what ID');
let channel = guild.channels.find(`id`, 'what ID');
if (message.author.id == loggedIn.pref.join(' ')) {
let msg = args.join(' ');
channel.send(msg);```
it is a say command for my bot
and i just cant get it to work
dont .find() with an ID, use .get(). collections are mapped by ID. IFfyou read the discord.js docs you will find this clearly stated.
you get ids with get
not find
i tryed that and still nothing
is the console outputting an error
also, you didnt tell us what if loggedIn.prefis, but jusging from
if (message.author.id == loggedIn.pref.join(' ')) {, this screams logic error to me.
He doesnt have an error most likely, just an if statement that will never be true because it makes no sense
no not that i now of
yeah
remove all your loggedin code
do a basic if
and try again
that way you know what's the issue
this wole bot that im doing is an unfinished bot that a friend gave me befor he stoped coding
so i dont know what im doing
learn how to code
well you should learn
How can I display emotes in d.py with this sort of script?
emotes = ctx.message.server.emojis
emotelist = ""
for emoji in emojis:
result += emoji. + " "```
My main question is how do I get the actual emote in the result emoji.
"<:{0.name}:{0.id}>".format(emoji)?
im trying to make it where someone joins it auto dms them saying thanks for joining my server(edited)
What lib?
d.js
On the https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-guildMemberAdd event get the GuildMember parameter, then the user object, and use the send method on that.
bot.on('guildMemberAdd', member => {
const channel = member.guild.channels.find('name', 'welcome');
if (!channel) return;
member.send("Thank you Joining my server");
});
``` but that doesn't dm me when i join the server
@slender thistle https://luis-fonsi.stole-my.pw/i/0a9t.png
const args = message.content.slice(prefix.length()).trim().split(/ +/g);
^
ReferenceError: prefix is not defined
at Client.client.on (C:\Users\23stephenx\Documents\EXP Bot\mybot.js:7:38)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at MessageCreateHandler.handle (C:\Users\23stephenx\Documents\EXP Bot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\23stephenx\Documents\EXP Bot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\23stephenx\Documents\EXP Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\23stephenx\Documents\EXP Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\23stephenx\Documents\EXP Bot\node_modules\ws\lib\event-target.js:120:16)
at emitOne (events.js:116:13)
at WebSocket.emit (events.js:211:7)```
this is the error that I get when I try to run any command:
```client.on("message", (message) => {
const args = message.content.slice(prefix.length()).trim().split(/ +/g);
const command = args.shift().toLowerCase();```
here is the line above and below
I tried looking around but my config.json file is correct
"prefix": "exp!",
const client = new Discord.Client();
const config = require("./config.json");
const fs = require("fs");```
that's the header
@upper ember Error?
I don’t get any error
Do member.user.send
That means the if statement is false.
Oh ok, the format should be correct
Eh well
@gilded thunder Most likely your bot doesn't have access to the emotes or something
does anyone here know how to link up an excel sheet (database) and JS? cause I'm really confused as of now
nope
also on your error before you use just prefix and its not defined in the code
yeah I fixed that
oki
var tableName = 'oTable';
var oTable = ctx.workbook.tables.getItem("myTable");
});```
I tried this but it said excel wasn't defined so I'm trying to figure out if I need to require something
why you trying to use excel as a database
something like mongodb or sqlite would be better
i use sqlite
i have a small project
and is excel really meant to be a "database"
well as long as it stores a matrix of values I'm fine with it
using excel as a database is really dumb
except the problem with sqlite is I downloaded it except I don't have anything to open it :/
use an sqlite db viewer
yes
you have to use a module like https://www.npmjs.com/package/better-sqlite3
How do you get the discord emoji ID?
\:emojiname:
hey for eris, would you need python to make music commands?
Eris is not a Python lib 
@heady zinc don't confuse people more thx

though you can use python for your music feature but i don't see why you would do that
I wouldn't really recommend mixing libs
i wasn't talking about mixing libs
i was talking about letting another language handle back-end music stuff
but there's not really any performance gain over JS and lavalink already exists so 
I meant more as in not connecting to WS two times
hmm
so for sqlite: db.run('INSERT INTO users(name, age) VALUES("Riko", 29)', ['C'], (err) => {
inserts Riko into Name and 29 into Age of Table users, right?
if I have a table with 12 headers, I would need to have (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) right
I think you can pick and choose which ones you're going to fill
ah
also, if I want to create another row
its the same right
except with all 12
wait, I just Create another row
and increase 12
i'm still unclear how to add a row
does anyone know?
nvm I figured it out 😄
quick question if I create a task in a class constructor is it run automatically or do i still have to explicitly call it with the event loop?
I'm a javascript / node developer, does anyone knows a good opensource bot as a starting point for a moderation commands type of bot,
because I need to implement some very specific use cases, but I want to have the basics already figured out. (please ping for reply)
d.js docs has a basic moderation example @tight coral
but honestly, just throw together the basics quickly
it isn't that hard
I was trying to avoid coding one, but we couldnt figure out how to make a !warn and !mute system with auto punishments based on defined thresholds (like 3 warns in past hour gets muted for an hour), but also like with moderation hierarchy, like mods can't warn other mods, trial mods cant warn mods, etc... closest thing was mee6, but ive been talking with the developers and their system is broken
honestly, theres no easy way to do it
logic wise is not that much complicated, but for generic bots, they dont usually allow that kind of customization
Hi
Is it ok if my bot change certain roles color every 3-5 seconds or could it be a problem with a too much number of roles modifications ?
(a problem with discord, not the bot performances)
Thats basically rainbow role color, it's against API tos
Oh 😮
Bots legitimately get banned for that
Ok thnx for you ansew, I will fix that
i know a dude who did something similar but for channel description fields
Timezones?
he put the current time in the channel description field, in all channels of his server, updated every second
if (!req.query.server_count || isNaN(req.query.server_count))
return res.status(400).send(`Error: property 'server_count' must be provided and must be a valid number`);
got this code for my express server, tho it errors, even when i give it a server count
(node:11280) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'server_count' of undefined
query is undefined
ok thx for your ansews I did not know it was forbidden
Yeah it's forbidden only because it's too much for discord to handle, and so we don't want to break it
Uh and a 1h, 12 or 24h of delay, does it pass or still not?
it is a number
its best off to go ask in the discord api server
But it's best to keep it at a big number just to be safe
I'm working on a temp mute command, and I've seen some code that I could use but I don't quite remember the thing it was like message.(Some date thing) - message.(Some date thing) for the count down
What would it be
Or is there a built in temp mute in discord.js
Is .setMute for voice or text?
I'm guessing voice
Thank you, and for my first question?
dunno
if (err) {
console.error(err.message);
} else {
console.log("Connected to the file database.");
}
});``` This line of code repeatedly tells me SQLITE_CANTOPEN - any ideas? the fie xyz.db is in my folder
and the file is read/write
in general how long does a reply for certification take? not sure if this is right place to ask
Not really the right place, but since you asked anyway it's not really on a schedule or anything, they're usually checked once a while in bulk
apologies and thanks for the response
does anyone have a oauth authentication example for a web admin interface (nodejs) ?
plz ping
why so hard to make description in the web he say 300 characters but i see there another bot without 300 characters :/
anyone can help me?
what
the description
theres a short and a long description
but i see another bot without 300 characters description
they probably have html and css
long description is ur html one and the short description is a smal one
^^
nope, they don't use html or css
uh
almost every bot page does
wait
link?
You have to have 300 characters for verification and accepting, but you can change it after that
I guess, not 100% sure
ahh okok
they could just have 40 classes in the html
lol
whether the bot will remain in aprove if using description outside his category?
@earnest phoenix can you send the link to that bot?
what bot? @quartz kindle
the one in the picture
what you want to do 😂
nope, this a new bot
are you sure?
yes
because i know who make this bot,
haha
lol
but i don't want to ask they how
uh
http://we-are-proud-to-be-develope.rs/585a50.png k thnks bootstrap
lol
discordgo + dca + music + proper embeds =
@sick cloud did you get fonts working?
yep, sure did
i got a different ttf file @earnest phoenix
ah
so once you load the file what do you use it as
the file name?
@sick cloud
or the font name
(node:72886) UnhandledPromiseRejectionWarning: Error: Could not load font file

i use Canvas.RegisterFont('./font-name.ttf', 'Font name'); then i use it as .setTextFont('22px "Font name"') for example
kk
registerfont doesnt exists
@sick cloud
wait nvm
nvm
(node:73170) UnhandledPromiseRejectionWarning: TypeError: Canvas.registerFont is not a function
@sick cloud
wut dis
I am @sick cloud it autocompletes on vs code as a method, but when I run it it says it’s not a command
dunno then
Canvas.registerFont('./fonts/Discord.ttf', 'Uni Sans Heavy');
thats how i do it 
@sick cloud this shud be working right?
const {Canvas} = require('canvas-constructor');
Canvas.registerFont('./uni-sans-bold-webfont.tff', 'Uni Sans Bold')
both of you are high
no
Ask your question
client.modlog = (guildid, type, mod, badguy, reason) => {
if (!reason) reason = "No reason provided";
const sqlite3 = require("sqlite3");
const db = new sqlite3.Database('./db/servers.db');
const Discord = require("discord.js");
db.get("SELECT * FROM servers WHERE id = ?", [guildid], (err, row) => {
if (err) return console.log(err.message);
if(!row) {
db.run(`INSERT INTO servers(id) values(?)`, [guildid], (err) => {
if (err) return console.log(err.message);
db.get("SELECT * FROM servers WHERE id = ?", [guildid], (err, row) => {
if (err) return (err.message);
const embed = new Discord.RichEmbed()
.setTitle(type + " case")
.addField("Moderator:", mod, true)
.addField("User:", badguy, true)
.addField("Reason:", reason, false)
console.log(row.modlog)
guild.channels.find("id", row.modlog).send(embed);
})
});
} else {
const embed = new Discord.RichEmbed()
.setTitle(type + " case")
.addField("Moderator:", mod, true)
.addField("User:", badguy, true)
.addField("Reason:", reason, false)
console.log(row.modlog)
guild.channels.find("id", row.modlog).send(embed);
}
})
};
umm
anyone have ideas why this doesn't wrok?
any errors?
nope
is it supposed to be a function you can use
maybe do function(guildid, type, mod, badguy, reason) { on top instead of (guildid, type, mod, badguy, reason) => {
try it
Eek function
client.log = (type, msg, title) => {
if (!title) title = "Log";
console.log(`[${type}] [${title}]${msg}`);
};
this works @knotty steeple
well idk
the log
the database works?
yes..
client.modlog = (id, type, mod, badguy, reason) => {
const sqlite3 = require("sqlite3");
const Discord = require("discord.js");
const { RichEmbed } = require("discord.js");
const db = new sqlite3.Database('./db/servers.db');
if (!reason) reason = "No reason provided";
db.get("SELECT * FROM servers WHERE id = ?", [id], (err, row) => {
if (err) return console.log(err.message);
if (row.modlog = 0) return;
const embed = new Discord.RichEmbed()
.setTitle(type + " case")
.addField("Moderator:", mod, true)
.addField("User:", badguy, true)
.addField("Reason:", reason, false)
guild.channels.find("id", row.modlog).send(embed);
});
};
does the id need to be int or text?
i dont see guild defined anywhere
guild.channels.find
if id is just the guild id, then it doesnt have the guild proprieties to check channels and send messages
if id is the entire guild collection, then it should be id.channel.find()
this isn't guild property, id is guild id
then where is guild defined?
you dont have a message collection in there either

you have Discord as your only entry point to discord
so you'd need to start from the beginning
client = new Discord()
client.guild.find(id).channel.find().send
you have client already defined outside the function, so if you can use that already, then yeah client.guilds.get(id).channels.find("id",row.modlog).send
find("id",row.modlog) this i dont know
i havent used the find() function
also, do you really need to redefine sqlite, Discord, richember and db? dont you have them globally defined outside the function?
or is it a module exports/run
client.modlog = (serverid, type, mod, badguy, reason) => {
const sqlite3 = require("sqlite3");
const Discord = require("discord.js");
const { RichEmbed } = require("discord.js");
const db = new sqlite3.Database('./db/servers.db');
if (!reason) reason = "No reason provided";
db.get("SELECT * FROM servers WHERE id = ?", [serverid], (err, row) => {
if (err) return console.log(err.message);
if (row.modlog = 0) return;
const embed = new Discord.RichEmbed()
.setTitle(type + " case")
.addField("Moderator:", mod, true)
.addField("User:", badguy, true)
.addField("Reason:", reason, false)
client.guild.find(id).channel.find("id", row.modlog).send
});
};
this is module.exports = (client) => {
why did you change id to serverid
now you need find(serverid) as well
and client.guilds
you should know that, not me
client.modlog = (serverid, type, mod, badguy, reason) => {
const sqlite3 = require("sqlite3");
const Discord = require("discord.js");
const { RichEmbed } = require("discord.js");
const db = new sqlite3.Database('./db/servers.db');
if (!reason) reason = "No reason provided";
db.get("SELECT * FROM servers WHERE id = ?", [serverid], (err, row) => {
if (err) return console.log(err.message);
if (row.modlog = 0) return;
const embed = new Discord.RichEmbed()
.setTitle(type + " case")
.addField("Moderator:", mod, true)
.addField("User:", badguy, true)
.addField("Reason:", reason, false)
client.guilds.find(serverid).channels.find("id", row.modlog).send
});
};
not working..
do you have a server id or a channel id?
because guild id and channel id are different
and a channel id does not need a guild
if you have id, get(id)
find is if you dont have the id
and need to find with channel name or something else
useCSS client.channels.get(ID).send(message here)
^
no need to use row.modlog
what...?
client.modlog = (serverid, type, mod, badguy, reason) => {
const sqlite3 = require("sqlite3");
const Discord = require("discord.js");
const { RichEmbed } = require("discord.js");
const db = new sqlite3.Database('./db/servers.db');
if (!reason) reason = "No reason provided";
db.get("SELECT * FROM servers WHERE id = ?", [serverid], (err, row) => {
if (err) return console.log(err.message);
if (row.modlog = 0) return;
const embed = new Discord.RichEmbed()
.setTitle(type + " case")
.addField("Moderator:", mod, true)
.addField("User:", badguy, true)
.addField("Reason:", reason, false)
client.channels.get(row.modlog).send(embed)
});
};
but his id is the server id
his channel id is in the database
try thistry { client.channels.get(row.modlog).send(embed).catch(e => console.log(e)) } catch(e) {console.log(e)}
so channels.get() is undefined
ok, how do I fix it? lol
try console.log(client.channels)
doesn't print anything
then the entire clients collection is missing
ie: your client is not discord's client, is has nothing to do with discord at all
what...?
I don't see a client variable
supposedly is in his function
or outside of it
since his function is assigning the function to a client
anyway i need to go to work, you help him
also i dont think youre using sqlite3 correctly
What are you trying to do
client.modlog = (serverid, type, mod, badguy, reason) => {
const sqlite3 = require("sqlite3");
const Discord = require("discord.js");
const { RichEmbed } = require("discord.js");
const db = new sqlite3.Database('./db/servers.db');
if (!reason) reason = "No reason provided";
db.get("SELECT * FROM servers WHERE id = ?", [serverid], (err, row) => {
if (err) return console.log(err.message);
if (row.modlog == 0) return console.log("Modlog is disabled in one of the server")
const embed = new Discord.RichEmbed()
.setTitle(type + " case")
.addField("Moderator:", mod, true)
.addField("User:", badguy, true)
.addField("Reason:", reason, false)
var guild = client.guilds.find("id", serverid);
guild.channels.find("id", row.modlog).send(embed);
});
};
???
??
what part of "if you have the id, you use .get()" and "if you have the channel id, you dont need guilds" you didnt understand?
you should be using db.all()
THE DB IS FINE
db.get assumes you will only get one row
stop typing in caps
Your guild var is incorrect
how is it incorrect?
var guild = client.guilds.get("id", serverid);
guild.channels.get("id", row.modlog).send(embed);
Client.guilds.get(id)
so will this work?
try it
wait no
you have an id variable
so
client.guilds.get(serverid)
You can't pass two parameters
so ```js
var guild = client.guilds.get(serverid);
guild.channels.get(row.modlog).send(embed);
?
yeah
client.modlog = (serverid, type, mod, badguy, reason) => {
const sqlite3 = require("sqlite3");
const Discord = require("discord.js");
const { RichEmbed } = require("discord.js");
const db = new sqlite3.Database('./db/servers.db');
if (!reason) reason = "No reason provided";
db.get("SELECT * FROM servers WHERE id = ?", [serverid], (err, row) => {
if (err) return console.log(err.message);
if (row.modlog == 0) return console.log("Modlog is disabled in one of the server")
const embed = new Discord.RichEmbed()
.setTitle(type + " case")
.addField("Moderator:", mod, true)
.addField("User:", badguy, true)
.addField("Reason:", reason, false)
console.log(row.modlog)
console.log(serverid)
console.log(type)
console.log(mod)
console.log(badguy)
console.log(reason)
var guild = client.guilds.get(serverid);
guild.channels.get(row.modlog).send(embed);
});
};
ok
lets see what this gives me
nothing
@earnest phoenix
So in my bot, im making 2 new commands (that only i can use): one that can restart the bot's application, and one that can end it. im using discord.net, and im adding these commands incase i can't restart/end it in visual studio (like if i'm not home) im not sure how to do this, so any help would be nice
Nice
id need to be int or text...?
IDs have to be strings in js
in in .net
i already got the part where only i can use it, i just need the part where i restart/end it
can you tag a role, like you can a user? @radiant compass
<@&000>





