#development
1 messages Β· Page 435 of 1
That line seems to be not present when I'm logged in and present when I'm logged out/incognito
@jovial sigil https://discordbots.org/bot/reaction-role try if you can see it
It's prob something in the light theme
@west raptor need python in env path
yes javascript need python 

just install python and add it to PATH
on system environment
but when you install it should add it automatically so
yes
did it install
yes
check if python is in path
idk
well idk anymore
ask in plexi server
idk how to help
i heard you are proficient in js and stuff
@keen drift sorry for the mention but I guess you missed my messages, the line is coming from the background image, its cut in those places (see-through) and what you're seeing is the bg color of the page. its not visible to everyone because it has to do with res scaling, its visible in wider res
@earnest phoenix The weird is that it's only visible on the light theme and not dark
It's the same background, it should be visible
this is just your eye playing tricks, its not visible in chrome preview as well
due to the fact the bg is dark
they blend in
Guess I'll upload my svg version
I can patch them in ps real quick if u want
Eh it's fine
alright xD
so i have this balance command, that shows how many coins someone has. when i try to do it on my beta instance of my bot, it shows the gif in the footer, but when im on the public and stable version it doesnt? why is this?
Beta Instance: https://vgy.me/Cou3Sg.png
Normal Version: https://vgy.me/uY2jHy.png
is the link right?
is the gif an animated emoji?
Are you running the beta version from your local pc?
Could be that your VPS can't access the URL for some reason
wat
I'd just dump the RichEmbed and see if it's actually in there
Dunno, just thinking about every possible failure option
Can you try curl https://i.gifer.com/ZXv0.gif on your VPS?
hmm ok
but isn't just an icon url
It shouldn't need to be able to access it no? You are just passing the URL
Should look like garbage data tho
why would vps download it in the first place
Hmm that does make sense
Try dumping RichEmbed struct
um wat https://vgy.me/v4LQH2.png
Well a terminal can't render an image
ik
So ascii conversion makes it garbage
its for text stuff only
ascii conversion 
also before wdym by dumping RichEmbed struct
Well in the RichEmbed object you create, console log it
i dont use RichEmbed
But that screenshot is a RichEmbed?
i just do {embed: {stuff}} on send()
Well, yeah that's RichEmbed, except it's just a standard obj
ok
In that case there shouldn't be a mistake?
Dunno if this works, but I'd try inspecting the element manually as well
Idk why, but for some reason 1 command doesn't show up in the bot's help list, even though its in the code
this is in C#, with discord.net library
How do you install quick.db?
npm i quick.db?
lang?
How do I add commands to my bot. Lol all Iβve got is βcookieβ and then it sends a cookie πͺ emoji
I wanna do milk to but when I do milk it disables cookie
:\
.addField('CPU', ${process.cpuUsage}`)
why i cannot use this
@earnest phoenix what lib?
discord.js
Does this work?
.addField('CPU', process.cpuUsage)
First line explains all, one of your fields has a value with more than 1024 characters.
hello.. anyone know how to get all data from all row in column using sqlite3 discord.js..?
my code :
bot.on('message', async message => {
if (message.author.bot) return;
const db = await dbPromise;
db.get(`SELECT * FROM badword WHERE guildId = "${message.guild.id}"`).then(row => {
if(message.content.toLowerCase().includes(row.badword1)) {
message.delete();
return message.reply(row.message)
});
});
////////////////////////////////////////////////////////////////////////
on my code only get 1 row, not all row...
example :
- Data at Database :
- row 1 :
f*ck, - row 2 :
s*it.
when write "f*ck", it's deleted and send message warn. But if, write s*it", no deleted message and message warn.
From what it sounds like you are asking, you see the SELECT * part of your query? That means select all columns, you can do stuff like SELECT columnName to only select a single column. Also, never concatenate values into your queries, use prepared statements instead like this:
db.get('SELECT columnName FROM badword WHERE guildId = ?', [message.guild.id]).then(... //your other stuff
The reason to use prepared statements instead of string concatenation is because let's say you had something like a place for a server to add a new bad word, some could do something like
let userInput = '", "");DROP TABLE badword;--'
db.get(`INSERT INTO badword (word, guild) VALUES ("${userInput}", "${guildId}")`) ...
But it really would be doing
INSERT INTO badword (word, guild) VALUES ("", "");DROP TABLE badword;--")
And goodbye badword table.
@earnest phoenix When you have time, can you check again: https://discordbots.org/bot/reaction-role
π
Saw dat
You saw nothing
...I don't know if you were talking about me typing or the message the other dude sent
Can someone help me with adding roles when someone hits 10 invites?
** Code Lang.:** Discord JS
Plz PM ME
π
Wait. what
I honestly dont think that's possible
And if it is, then it's hella hard to achieve
Hella hard πππ
so, anyone has an idea of how?
sigh Harder than normal
looking at the official documentation, there is a .fetchInvites() method for the Guild class. It works like this
// Fetch invite creator by their id
guild.fetchInvites()
.then(invites => console.log(invites.find(invite => invite.inviter.id === '84484653687267328')))
.then(console.error);
I'd suggest finding that on the documentation and then going from there
You could even look at the other classes and see if anything else there would work for you
I know how to check them
Hello, i'm using discord.py, non-rewrite.
Can someone here help me with some properties of discord.Invite?
I read in the documentation that you get get the number of uses from an invite. I used
inv = await client.get_invite(CODE)
uses = inv.uses```
but it returns None every time. I'm looking to use the int value that SUPPOSEDLY comes from inv.uses, but I can't seem to retrieve the value?
but when someones joins
to add the role if they have an amount of invites
PM me plz
gtg
I think he's asking how to give autoroles once they reach a certain number of invites
Which, if he knows how to check them, that should be really easy
So like an inviter role π€¨
His question is unclear anyway π€·ββοΈ
Like, I found both of the classes and methods I needed to use to do that and it only took me a few minutes. lol
The documentation is super good for this
@young wind Do you expect the .get_invite() to GIVE you the code, or did you put a url to the invite in the brackets?
Because it's usage is .get_invite(url)
According to the docs, I use get_invite() to retrieve an invite object, which I SHOULD be able to use to get the uses from.
Yes, I use get_invite("https://discord.gg/123456 ")
The client class and Invite class are two different things. In reality your getting the info like this
discord.client.get_invite().uses
When in reality you need to get uses using the actual Invite class, not the client, like this
discord.invite.uses
Yes, but I need a way to get the invite object in the first place.
(Which is supposedly returned by get_invite())
What invite are you actually using, if you could show it
Dont worry, I'm not gonna spam you or anything :P
np
Thx guys
I am just messing around a bit with the webhooks and they basically seem to work. But when I try to access the post data, i fail at it. I am using a PHP script which sends to a webhook and it just doesn't send anything.
<?php
include 'Client.php';
$discord = new Client('webhookurl');
$discord->send('A vote!\n'.$_POST["type"]);
?>
Just sending "A vote!" Works but using the post data fails
Ah that could be
@keen drift looks good
I still can't figure out how to, has anyone got a clue? php://input as resource still doesn't work
@high lava .catch(console.error)*
what?
cc this
// Fetch invite creator by their id
guild.fetchInvites()
.then(invites => console.log(invites.find(invite => invite.inviter.id === '84484653687267328')))
.then(console.error);
lol
Wait a sec
Wait. Nvm
I just took it from the official website. They could figure it out. lol
oof
I still haven't got any further with the webhooks.
<?php
include 'Client.php';
$data = json_decode(file_get_contents('php://input'), true); echo $data;
file_put_contents("debug.txt", $data);
$discord = new Client('url');
$discord->send('Even this does not work with the test webhook but opening this page in browser does');
if ($data) {
$discord->send($data);
}
$discord->send('A vote!\n'.print_r($data));
?>
That debug file is always empty after a test webhook
the team does not work, help please
bot.on("message", async message => {
if(message.author.bot) return;
if(message.channel.type === "dm") return;
let prefix = botconfig.prefix;
let messageArray = message.content.split(" ");
let cmd = messageArray[0];
let args = messageArray.slice(1);
if(cmd === `${prefix}info`){
let bicon = bot.user.displayAvatarURL;
let botembed = new Discord.RichEmbed()
.setDescription("Bot Information")
.setColor("#ffa500")
.setThumbnail(bicon)
.addFiled("Bot Name", bot.user.username)
.addFiles("Created on", bot.user.createdAt);
return message.channel.send(botembed);
}
});
team?
what am i doing wron
const { body } = await superagent
.get('aws.random.cat/meow');
const embed = new Discord.RichEmbed()
.setColor(0x954D23)
.setTitle("Meow :cat:")
.setImage(body.file)
message.channel.send({embed})
} else
});```
hm?
why is there an else
Iβm trying to collect statistics for how many commands are used per day
I guess I can count the commands used and send them every set interval to the database
But still trying to figure out how to determine when 24 hours have passed since I usually fo maintenance every now and then and the bot restarts π€
Any ideas?
timer.setUTCHours(24);
timer.setUTCMinutes(0);
timer.setUTCSeconds(0);```
this will set timer to exactly the next midnight utc from any point you start it
then just deduct from it the current time and use the result in a settimout
That'll only post like once every 24 hours, and when I restart the bot the current number stored in memory will be lost/reset back to 0
then why dont you just send it like every 60 seconds?
if you have a database setup correctly, the transaction should not cost too much resources
or you send it manually whenever you restart the bot, if you have a restart command
but that doesnt work for crashes
The same issue still exists. If I send it every 30 seconds, when can I tell that say 24 hours have passed since I first started sending?
ah i see what you want
do it like this, use the code above to get the midnight utc timer, push that to the database as a row/index, and then feed the content into that by checking if the time already exists
after 24 hours have passed, the timer wont match anymore, and the database will create a new row instead of feeding the existing one
then you can fetch the amount of commands for each 24h timeframe
Hi, I am currently making a system that when reacting to send a message in my private, but is speaking the following error: 'Can not send messages to this user' being that my dm is released
Excuse me i am trying to make a eco bot and i am ok at java but not the best and i try to run my bot but it says squlite3 module not found and i tried downloading squlite3 but bunch of errors poped up please help
please help
java and sqlite 
yah
Ok what is squlite
*squlite3
It needs to be sqlite
i wonder if he meant javascript 
Yah sorry i meant sqlite3
Also for eco you should use a process database like postgresql
Yha i meant javascript im sorry
Oh
Yah
Hastebin
how to fix it, why the red wave?
yeah ?
itβs case-sensitive
stop
stop what
this is bot for Discord, one guy as well as me, the current he does not have a red wave
I have
still dont know what you mean as a red wave
again
because you did a closing bracket after the closing quotation mark
^
?
fs.readdir("./commands/"), (err, Files) => {
if(err) console.log(err);
let jsfile = files.filter(f => f.split(".").pop() === "js")
if(jsfile.length <= 0){
console.log("Couldn't find commands.");
return;
}
jsfile.forEach((f, a) =>{
let props = require(`./commands/${f}`);
console.log(`${f} loaded!`);
bot.commands.set(props.help.name, props);
});
});
??
wat
I have instead of the hands CLOVES
and yet, what is a
"nodemon" is not internal or external command, executable program or batch file.
why ERROR
Weirdest conversation I've seen so far....
Help please
C:\Users\Tishin\Desktop\project\IlychBot\index.js:12
let jsfile = files.filter(f => f.split(".").pop() === "js")
^
ReferenceError: files is not defined
at fs.readdir (C:\Users\Tishin\Desktop\project\IlychBot\index.js:12:18)
at FSReqWrap.oncomplete (fs.js:169:20)
files is not defined
guys, when I tried to do
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
``` it doesnt work and idk how to fix it
Is your port being forwarded?
Are you hosting on a VPS or at home?
im hosting using glitch
im so confuse on how to award the users when they upvote
@spring ember
it's always the best practice to first test the features before you get yourself in these kind of awkward moments
π€
So is there any way to setup a bot just so i can send embeded messages with its own profile pic?
Hey guy's Im a little bit stumped by this, so hopefully one of you can help me.
I have this which should be adding roles to a member when they join the guild. This code is in my guildMemberAdd event, however it is returning a Missing Permissions error even though the bot has all permissions including administrator (for testing purposes). Any chance that any of you have any ideas?
Code
let moduleConf = client.modules.get(member.guild.id);
if(moduleConf.autoRole.enabled){
let roles = [];
if(moduleConf.autoRole.role.length > 0){
moduleConf.autoRole.role.forEach(role => {
let roleID = member.guild.roles.find('id', role);
if(!roleID) return;
roles.push(roleID.id);
});
}
member.addRoles(roles, 'Auto Role added').then(() => {
console.log('role added');
}).catch(console.error)
}
Error
{ DiscordAPIError: Missing Permissions
at item.request.gen.end (C:\Users\RedJambo\Desktop\Discord Bots\PublicBot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:71:65)
at then (C:\Users\RedJambo\Desktop\Discord Bots\PublicBot\node_modules\snekfetch\src\index.js:215:21)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
name: 'DiscordAPIError',
message: 'Missing Permissions',
path: '/api/v7/guilds/376568990048321538/members/155149108183695360',
code: 50013 }
FYI: I am writing in NodeJS using the discord.js API
That usually means that the role(s) your trying to add is higher than your bots highest role (in the Server Settings "Roles" tab, position-wise).
Go to the Roles tab and make sure the role(s) your trying to add are all below the bots highest role.
That was my first thought.. so I put it at the very top of the list (I should have added that in the original post) but still no luck
I put the bot role at the top of the list that is.
Weird.. π
I'll agree to that one
So it looks like I managed to fix it... my code now reads:
let moduleConf = client.modules.get(member.guild.id);
if(moduleConf.autoRole.enabled){
let roles = [];
if(moduleConf.autoRole.role.length > 0){
moduleConf.autoRole.role.forEach(role => {
let roleID = member.guild.roles.find('id', role);
if(!roleID) return;
member.addRole(roleID, 'Auto Role Added').then(() => {
console.log(`role added`);
}).catch(console.error);
});
}
}
I moved the member.addRole to be in the forEach loop and it solved the problem. I have a feeling that member.addRoles doesn't like adding an array of roles if there is only one role.

@prisma panther what language?
any language can do it. just use whatever you're already using
I dont know how to do anything π€·
do you even have a bot?

What's the difference between a user and a member in the sense of discordMember and discordUser?
Member has additional properties
For instance, when the user joined the server
In most libs, it will probably extend from the user model
Meaning you can compare members with users
But a member is associated with a guild (server), and a user is not
So member is on the same server and a user isn't present?
Yeah if you want to retrieve a member you'll have to call it with a guild
In python it's like
member = client.get_guild(id).get_member(id)
and user : discordUser
To simplify, a discordUser represents just the person, nothing more
a discordMember represents the person, but also it's connection to a specific server
Okay, thanks 
member has roles and nicks
@gilded thunder a user has basics like ID and username. member has extras like roles, nickname etc that are guild specific.
and perms
^
can anyone help get me a simple af bot? I need a bot that can ban @here or @everyone while DM each one why.
Why you wanna ban everyone 
Seems a bit dodgy.
As if you found a leaked token and want to nuke servers with it.
I also have nitro.
{ DiscordAPIError: Missing Access
at item.request.gen.end (/home/timotejroiko_gmail_com/astrobot/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:71:65)
at then (/home/timotejroiko_gmail_com/astrobot/node_modules/snekfetch/src/index.js:215:21)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:118:7)
name: 'DiscordAPIError',
message: 'Missing Access',
path: '/api/v7/channels/459919817382821888/messages/459920180940898304/reactions/%E2%97%80/@me',
code: 50001 }
my bot was added to a server and started giving off these, never seen them before
something related to reactions, but it does have permission to use reactions
dunno anything bout d.js but it looks like ur bot has no perms to add reactions? idk
it should have tho
try checking the bot permissions in that server using eval
or just kindly ask them if your bot has the add reactions permission
it was removed from the server, cant check anymore
ow
did this happen before or after it was removed
before doing anything, i have a code to check for the permissions i need, including adding reactions, but the code didnt say anything, so im assuming no permissions are missing, or there is another permission required that im not aware of
before
Hmm
Seems like you lost access to the reaction before your bot could perform the action that it was trying to do
Like being denied access to reaction or that channel or being removed from that guild
yeah which is very strange
the reactions are for my pagination in the help menu, they're fired off immediately
Yeah most likely it was removed from the server before your bot could carry out that action it was trying to do
Well generally these should rarely happen, but there is still a chance for it to happen when the 2 actions coincide
anyone have an idea on how to get started with a web dashboard?
well its done
Then from there slowly convert the placeholder values to actual dynamic values from your bot
so i just tried to remove reaction permissions in my server, and the bot responded correctly
i just dont know how im going to make users log in to my website so that they can customize the bot
is this true?
apparently it needs read message history to add reactions
I don't have 2FA on but my bot can use the orange permissions.
@bleak sapphire implement oauth2 and make it possible to list servers etc, thats a good start.
Get the authorization and login/logout etc out of the way, make sure your bot has a good database, then you can do other things.
nope
Currently my bot is sharding and it runs on three shards. I am wondering if I could have a separate temporary "maintenance" bot process and run it on all the shards?
What're you wanting to do that for exactlty? Maintaining some functionality?
like a daily task
realized that i have left my cleanup db.py script in the dust for quite a long time
So it'd change over on cron?
It might be useful to rewrite and stuff maybe the server would catch fire less often if the db is cleaned up
That'd be good
yeah discord limits me to that 3 shards
i cant make one instance across all shards temporarily
wait, is manage webhooks considered a dangerous moderation tool?
It can be, it can be used like a bot or userbot to spam channels etc.
Also guys, how do you get the max amount of memory on your dedi/VPS, and how do you get CPU usage? (node.js/discord.js)
well I mean, to the point when you are required to have 2fa enabled to have that permission
π
Yeah. I don't think thats true though, I've been able to use those permissions though I don't have 2FA.
in servers that require 2fa?
Maybe.
yeah it applies to servers with 2fa enabled
π
@sick cloud take a look at os-utils on npm that gives some usage stats like memory and cpu.
ππ» π
virify
Ok
?
You need {} after catch I think
Doesn't catch always have to be wrapped in brackets?
{
try {} catch {}``` (node 10 with flag)
or ```js
try {} catch (_owoWhatsThis) {}```
thank you!
πΊπΈ
why does not it work? what's the problem?
const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
if(!message.memder.hasPermission("MANAGE_MEMBERS")) return message.reply("Sorry pal, you can't do that.");
let rMember = message.guild.memder(message.metions.users.first()) || message.guild.members.get(args[0]);
if(!rMember) return message.reply("Could't find that user yo.");
let role = args.join(" ").slice(22);
if(!role) return message.reply("Specify a role!");
let gRole = message.guild.roles.find(`name`, role);
if(!Role) return message.reply("Could't find that role.");
if(rMember.roles.has(gRole.id));
await(rMember.addRole(gRole.id));
try{
await rMember.send(`Congrats, you have been given the role ${gRole.name}`)
}catch(e){
message.channel.send(`Congrats to <@${rMember.id}>, trey have been given the role ${gRole.name}. We tried to DM them, but their DMs are locked.`)
}
}
module.exports.help = {
name: "addrole"
}
what's not working?
dont expect us to know, tell us what you're experiencing
Well, when I write m! addrole the bot should give out the role I wrote, and it does not what does not. Does not work!
i can already see the first error
?
This: message.guild.memder(message.metions.users.first()) || message.guild.members.get(args[0]);
Should be: message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
still does not work?
you get your member by his id ?
?
How can i convert a image to CSS code?
And the url has to be https or else it wouldn't load
so I'm trying to insert data into multiple columns using pymysql.
The Code
conn = pymysql.connect(host = 'localhost', user = "myuser", passwd = "mypass", db = "db", port=xxxx)
cursor = conn.cursor()
cursor.execute("INSERT INTO Table(Column1, Column2) VALUES (%s,%s)", (variable1, variable2))
It would return the following error:
query = query % self._escape_args(args, conn)
TypeError: not enough arguments for format string
Any ideas?
how would you fix the tiles going crazy in an embed in d.js
its just discord, titles and description work differently compared to fields
yea?
with Jimp in discord.js
Hmm
I've used jimp for a bit, but soon I moved to using canvas and the speeds are way faster
the problem is it gives The source must be a Jimp image
Not saying jimp is bad or anything
Oh that means you have to make it a jimp image first, probably loading the image using jimp first and using that
Like in this lenna is the jimp image
oof
Jimp.read("C:/dingus/"+message.author.id+".jpg").then(function (image) {
image.mask(message.author.avatarURL, 50, 20 );
image.print(font, 300, 30, message.author.tag);
image.write("C:/dingus/"+message.author.id+".jpg");
// do stuff with the image
}).catch(function (err) {
// handle an exception
});
is the current thingy
but
I've tried some other ways
oo
.>
I think you should try putting them together
like image.mask(...).print(...).write(...)
oh
woopsae
Meaning Jimp.read(message.author.avatarURL).then(function (avatar) ...
and avatar will be a jimp image
message.author.avatarURL is a URL, not an image
nor a jimp image
yeet
yup hope that solves your problem
;-;
well
I don't get errors, so it edits the picture, but
it doesn't do it right
oof
Now ima have to check everything again grrr
yeah then you will need to adjust your code I guess
ik
Does anybody know how to give a bot watching status?
lib?
async or rewrite
async I assume π
http://discordpy.readthedocs.io/en/latest/faq.html#how-do-i-set-the-playing-status and would be something like game=discord.Game(type=1, url="twitchurl") type 1 is streaming and url must be a twitch url to show up as streaming 
Guys how to remove a specific value from a column in sql?
Like I want to delete one of the channels IDs: https://equalizerbot.xyz/screenshot/e1sj6q5b.png

Guys need a bit of help to get started
Is there how to guide to making a bot with basic code blocks
I did a quick look around on rules and announcements couldnβt find any links
lmao what
I want to make a bot that sends a command to a 3rd party website and returns the output
Ok
chose your language/environment, get a basic bot running (connect to discord, listen to messages), then take a look at http requests
Itβs a call to a website that links to google translate api for free
@solemn valve if you're using nodejs you could just use https://www.npmjs.com/package/google-translate-api
that might be perfect im checking it out
@real ginkgo ask your question?
Discord.js?
Yes
Use client.on
made a bot, its on my server
here under the events tab
you can see all the events you can
client.on
do i need to download visual studio and node.js?
im an ex coder it shouldnt take me long to get the hang of it again
nope
Ok, you have to code it first and then host it
Yea
what visual studio workloads do i need to install
ASP.NET and web development + universal windows platform development?
any editor will do for node.js
personally Visual Studio Code is good, but its up to you
k installing just universal package if i need something else ill assume it'll ask
How should I limit urban to give NSFW responses?
dont think you can
thank you for help so far
@sand roost just limit the command to NSFW channels, thats what I'd do. the api might have a safe search thing though, dunno
guys
any idea where the information on Bucketypes are? Trying to use cooldowns
anyone used cooldowns
pls
;-;
this question might be more suitable to be asked in dapi, but if I were to get a user with bot.get_user_info() will I be able to do further actions on them even if they are already in the server? like I know this is more used to hackban users and so on...
@buoyant oak
@commands.cooldown(rate,per,BucketType)
# Limit how often a command can be used, (num per, seconds, commands.Buckettype.default/user/server/channel)```
Why does not it work, why does not the role play out ???
const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
if(!message.member.hasPermission("MANAGE_MEMBERS")) return message.reply("Sorry pal, you can't do that.");
let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
if(!rMember) return message.reply("Could't find that user, yo.");
let role = args.join(" ").slice(22);
if(!role) return message.reply("Specify a role!");
let gRole = message.guild.roles.find(`name`, role);
if(!Role) return message.reply("Could't find that role.");
if(!rMember.roles.has(gRole.id)) return message.reply("They don't have role.");
await(rMember.addRole(gRole.id));
try{
await rMember.send(`Congrats, you have been given the role ${gRole.name}`)
}catch(e){
message.channel.send(`Congrats to <@${rMember.id}>, trey have been given the role ${gRole.name}. We tried to DM them, but their DMs are locked.`)
}
}
module.exports.help = {
name: "addrole"
}
@solid cliff ty
@ruby dust Yes?
Guys how to remove a specific value from a column in sql?
Like I want to delete one of the channels IDs: https://equalizerbot.xyz/screenshot/e1sj6q5b.png
Just do a sql statement to filter by channel id and then get the index of that filter which would be the serverid to remove it
@commands.command(pass_context=True, hidden=True)
@commands.cooldown(1,5,commands.BucketType.user)
async def economy(ctx, Command:str=None):
if Command == None:
await bot.say(" THIS IS THE ECONOMY MENU:")
~~slightly ~~confused
very confused
thanks @knotty steeple
also isnt doing prefix + "COMMAND" annoying
so your bot is 1 file?
yea riht now it is
fs.writeFile('storage/userData.json', JSON.stringify(userData), (err) => {
^
TypeError: Converting circular structure to JSON
at JSON.stringify (<anonymous>)
at Client.bot.on.message (C:\Users\fazin\OneDrive\Documents\Coding\ecbot\app.js:115:48)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at MessageCreateHandler.handle (C:\Users\fazin\OneDrive\Documents\Coding\ecbot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\fazin\OneDrive\Documents\Coding\ecbot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\fazin\OneDrive\Documents\Coding\ecbot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\fazin\OneDrive\Documents\Coding\ecbot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\fazin\OneDrive\Documents\Coding\ecbot\node_modules\ws\lib\event-target.js:120:16)
at emitOne (events.js:116:13)```
error in the json data, or not a proper object
msg.channel.fetchMessages({ limit: 100 }).then(messages => console.log(messages.size).catch(console.error);
```does not result to anything
isnt catch supposed to be after the then()?
you're missing a closing paren
how does one make a git pull command? so I can actually pull my bots updates w/o needing to reupload all the files lol
seems to be in the code the json is fine if i comment the command it works fine
var guildMoney = 0;
var guildUsers = 0;
var guildRichest = '';
var guildRichest$ = 0;
for (var i in userData) {
if (i.endsWith(message.guild.id)) {
guildMoney += userData[i].money;
guildUsers += 1;
if (userData[i].money > guildRichest$) {
guildRichest$ = userData[i].money;
guildRishest = userData[i].username;
}
}
}
message.channel.send({"embed":{
title: "Balance",
color: 0x4386f2,
fields:[{
name:"Accounts",
value:guildUsers,
inline:true
},
{
name:"Total Money",
value:guildMoney,
inline:true
},
{
name:"Richest Accounts",
value:`${guildRichest} with ${guildRichest$}`
}]
}})
}
fs.writeFile('storage/userData.json', JSON.stringify(userData), (err) => {
if (err) console.error(err);
}); */``` here is the code
*/ what is that there for
could be that userData contains properties that are incompatible with json
multiline comment π€
console.log the userData to check
thankssss
@prime cliff Can you send the query?
My Commands Aren't working when i have a chat filter on what should i do?
what kind of chat filter?
fs.writeFile('storage/userData.json', JSON.stringify(userData), (err) => {
^
TypeError: Converting circular structure to JSON
at JSON.stringify (<anonymous>)
at Client.bot.on.message (C:\Users\fazin\OneDrive\Documents\Coding\ecbot\app.js:115:48)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at MessageCreateHandler.handle (C:\Users\fazin\OneDrive\Documents\Coding\ecbot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\fazin\OneDrive\Documents\Coding\ecbot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\fazin\OneDrive\Documents\Coding\ecbot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\fazin\OneDrive\Documents\Coding\ecbot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\fazin\OneDrive\Documents\Coding\ecbot\node_modules\ws\lib\event-target.js:120:16)
at emitOne (events.js:116:13)``` i get this error if i dont comment ```js
fs.writeFile('storage/userData.json', JSON.stringify(userData), (err) => {
if (err) console.error(err);
});``` i logged `userData` got `{}` but it worked before i added
var guildMoney = 0;
var guildUsers = 0;
var guildRichest = '';
var guildRichest$ = 0;
for (var i in userData) {
if (i.endsWith(message.guild.id)) {
guildMoney += userData[i].money;
guildUsers += 1;
if (userData[i].money > guildRichest$) {
guildRichest$ = userData[i].money;
guildRishest = userData[i].username;
}
}
}
message.channel.send({"embed":{
title: "Balance",
color: 0x4386f2,
fields:[{
name:"Accounts",
value:guildUsers,
inline:true
},
{
name:"Total Money",
value:guildMoney,
inline:true
},
{
name:"Richest Accounts",
value:`${guildRichest} with ${guildRichest$}`
}]
}})
}
``` and the i comment it, i still get an error
that was confusing
Guys give me a Welcome Message Java Script Code (discord.js)
hold on i worded that bad
if you get {} that means the object is empty
i dont think you can stringify an empty object
@sick cloud this is what my chat filter looks like
``import discord
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
import time
Client = discord.Client()
client = commands.Bot(command_prefix = "+")
chat_filter = ["PINEAPPLE", "APPLE", "CHROME"]
bypass_list = []
@client.event
async def on_ready():
print("Bot is online and connected to Discord")
@client.event
async def on_message(message):
contents = message.content.split(" ") #contents is a list type
for word in contents:
if word.upper() in chat_filter:
if not message.author.id in bypass_list:
try:
await client.delete_message(message)
await client.send_message(message.channel, ":underage: BE GONE CURSE WORDS! :angry: ")
except discord.errors.NotFound:
return
@client.event
async def on_message(message):
if message.content == "p!info":
await client.send_message(message.channel, "Name: Penguin Helper Version: 0.0.1 Created by Musicmanlogo#6435 Coded by Penguin#7006")
@client.event
async def on_message(message):
if message.content == "p!help":
await client.send_message(message.channel, "Name: Commands Help,Info Prefix p! More Commands Coming Soon")
client.run("Taco.18")``
codeblock pls
k
code block is triple `
It is send_message
Not send message
You probably should use chat_filter instead of chat filter
Why do you have client and Client defined?
delete_message, not delete message
ik
Ah ok nice one
i changed
Chatfilters are hard tho
because that was the token for the bot
CommandNotFound?
Preferences, probably 
I'd really recommend using the rewrite version (if you can maintain the code on breaking changes)
Or, as they said before,
well im not coding this by myself
i have someone else helping me
That's the most annoying thing (IMO) when you have thousands of thousands of code, and you have to refactor the whole thing because you miss something from the async branch's capabilities
Use async2rewrite :^)
Lol, nice meme
@slender thistle where do you see
send message
chat filter
delete message
Because im not seeing it and im looking at it
It looks like you followed a bad YT tutorial mate
not really
That direct import of Bot, and the botclient
quick question before i go to bed but i get this console output when i try logging all my reminders (there are 2)
code:
module.exports = async () => {
const reminders = [];
const r = await db.table('reminders');
if (!r) return;
await r.forEach(obj => {
reminders.push(obj.reminders);
});
// monitor reminders
setInterval(() => {
reminders.forEach(reminder => {
let r = reminder[reminders.indexOf(reminder)];
console.log(r);
});
}, 3000);
}
That's a mistake of a bad youtuber
Actually, true
so its like only logging the same one ^^
You only need import discord, since you are using on_message event instead
He wrote more commands coming soon, so I assume he'll use the commands.ext in the future
Which is fine, but then he won't need the client to be defined
Or just use on_message event in the same file over and over
And he'd need to change the decorators
You also could just use on_message event instead of thousands
Oh waot
Is that on message I see

Nvm
@sick cloud long the entire db.table to make sure the reminders are there
they are
then log each step to see until where they are being moved correctly
yeah
gonna try that now
because i logged the db table and got this
so the reminders are there
but only one is given
sa
@quartz kindle ^^
this doesnt look right reminders.forEach(reminder => { let r = reminder[reminders.indexOf(reminder)]; console.log(r); });
try logging reminder
instead of reminder[indexof]
okay
Ah, yeah. My database data comes out as a list aswell. I always return the first item if the list length is one.
for of 
weird question but how do i actually compare the times?
i have setAt which is a date of when the reminder was created, and remindAt which is how long to wait before reminding the user in ms
but idk what to do xD
What langauge do you use? @sick cloud
node.js / discord.js
Ah, then you are ouy luck from me atleast.
okay
if current timestamp - saved timestamp > target timeframe
Question so a bot can't bulkdelete his own messages on this server? why is that?
I have seen people clean up the commands of there bot, I want to achieve this too, but for some reason it's not working in this server due to missing permissions
it works on another server
msg.channel.fetchMessages({
limit: 100
}).then(messages => {
var messagearray = messages.filterArray(m => m.author.id === bot.user.id)
msg.channel.bulkDelete(
messagearray
).then(m => {
msg.channel.send({
embed: {
color: 0x20B2AA
, title: `Successfully cleaned up ${m.length} messages from ${bot.user.name}`
, timestamp: new Date
, footer: {
icon_url: bot.user.avatarURL
, text: `Replying to ${msg.author.tag}`
}
}
})
}).catch(e => {});
})
which permission is missing?
doesn't say
if its missing manage messages, then its not seeing the messages as its own
no perm for bulk-delete
I filter it so it's only the bots messages so it can only be the messages of the bot
the error doesnt specify which permissions are missing, you have to check them yourself
how?
sure
yeah no perm, but I can't see why it would do that, I filter all messages and only allow messages from the bot to be kept
var messagearray = messages.filterArray(m => m.author.id === bot.user.id)
there is a specific way to do it, if you just scan for messages it doesnt work
i think you need the message object
so instead of bulkdelete, you have to loop over each message and delete one by one i think
I had that before but they said it wsn't good xd
i dont know then, my bot doesnt have that feature
it only deletes his temporary message when processing a command
it works when looping over it, I guess will use that for now
you can check for permissions and then use bulk if you have them, and loop if you dont
best of both worlds xD
Requirements
Required:
Node.js 0.10.x or greater
Web Browser if not using Node.js
Optional:
Audio
Node.js 0.12.x
ffmpeg/avconv (needs to be added to PATH)
Documentation / Gitbooks
Getting Started:
Installing
Stable npm install discord.io
Latest npm install izy521/discord.io
Example
var Discord = require('discord.io');
var bot = new Discord.Client({
token: "",
autorun: true
});
bot.on('ready', function() {
console.log('Logged in as %s - %s\n', bot.username, bot.id);
});
bot.on('message', function(user, userID, channelID, message, event) {
if (message === "ping") {
bot.sendMessage({
to: channelID,
message: "pong"
});
}
});
....
About
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily.
Object-oriented
Predictable abstractions
Performant
100% coverage of the Discord API
Installation
Node.js 8.0.0 or newer is required.
Ignore any warnings about unmet peer dependencies, as they're all optional.
Without voice support: npm install discord.js
With voice support (node-opus): npm install discord.js node-opus
With voice support (opusscript): npm install discord.js opusscript
Audio engines
The preferred audio engine is node-opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose node-opus. Using opusscript is only recommended for development environments where node-opus is tough to get working. For production bots, using node-opus should be considered a necessity, especially if they're going to be running on multiple servers.
Optional packages
zlib-sync for significantly faster WebSocket data inflation (npm install zlib-sync)
erlpack for significantly faster WebSocket data (de)serialisation (npm install discordapp/erlpack)
One of the following packages can be installed for faster voice packet encryption and decryption:
sodium (npm install sodium)
libsodium.js (npm install libsodium-wrappers)
uws for a much faster WebSocket connection (npm install uws)
bufferutil for a much faster WebSocket connection when not using uws (npm install bufferutil)
Example usage
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(Logged in as ${client.user.tag}!);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('pong');
}
});
client.login('token');
code block please
^
yeah github

When you guys debug a bot while it's online, what do you normally do?
ATM. I'm making the actual Server go offline and then hosting the Bot on my PC for the time I'm doing it
Well, what do you do then?
I have 2 modes in my bot live and testing in testing mode the bot adds t to the prefix :/ so it dosent mess with the other bot
That's a good idea
I'm just worried about it going offline while people are using it
Well, whatever. I was just adding the server count so it's not that bad
just have another client/token and have each one on a different channel
Yeah. I'm just gonna make a copy of the bot, one for testing and one live one
Then just update the repository when the testing version isn't broken
Wait a second. nvm. there's an easier way, if I only I read what you said first. lol
Using jimp and I'm trying to send a buffer but I'm having slight difficulty.
Code:
canvas.getBuffer(Canvas.MIME_PNG, buffer => {
var attach = new Discord.Attachment(buffer, "slot");
msg.channel.send({files: [attach]});
});
Error:
C:\Users\Brad.INFINITE\Documents\GitHub\amanda\node_modules\discord.js\src\client\ClientDataResolver.js:274
} else if (resource.pipe && typeof resource.pipe === 'function') {
^
TypeError: Cannot read property 'pipe' of null
at ClientDataResolver.resolveFile (C:\Users\Brad.INFINITE\Documents\GitHub\amanda\node_modules\discord.js\src\client\ClientDataResolver.js:274:25)
at Promise.all.options.files.map.file (C:\Users\Brad.INFINITE\Documents\GitHub\amanda\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:154:30)
at Array.map (<anonymous>)
at TextChannel.send (C:\Users\Brad.INFINITE\Documents\GitHub\amanda\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:153:40)
at Jimp.canvas.getBuffer.buffer (C:\Users\Brad.INFINITE\Documents\GitHub\amanda\plugins\gambling.js:65:19)
at C:\Users\Brad.INFINITE\Documents\GitHub\amanda\node_modules\jimp\index.js:2255:27
at C:\Users\Brad.INFINITE\Documents\GitHub\amanda\node_modules\stream-to\index.js:39:7
at exports.PNG.onEnd (C:\Users\Brad.INFINITE\Documents\GitHub\amanda\node_modules\stream-to\index.js:18:5)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
Discord.js
Canvas died so, I'm moving to jimp
well from the error stack thats what it looks like
something to do with discord.js
Yeah but it may just me not providing a proper attachment or something

hmm why not
One of the deps doesn't build properly
if cache gets cleared and you try and build it then run, it'll throw Canvas.createCanvas is not a constructor even though it is
or however you make a canvas
Yes. It is a constructor. I used it and it worked
you make a new canvas like this let canvas = new Canvas(width, height);
well probably you are using the old api
Well if you are talking about this: https://www.npmjs.com/package/canvas
createCanvas is not listed there
one sec
let me check what it really is
let canvas = new Canvas.createCanvas(553, 552);
let ctx = canvas.getContext("2d");
That's what I used to use and that has worked
So
Yeah I am saying it has been changed to let canvas = new Canvas(553, 552);
Try that and it will work
ok. Then that leaves me to another issue
^ can confirm
Heroku doesnt build canvas
you host on heroku?
use prebuilt then
and there are no buildpacks that I could find that support heroku18
well. Let's try that, then
Meant to be able to run on Travis and AppVeyor so I am assuming it'll work on heroku as well
It does build this, yes
yeah you can use this then, its basically the precompiled canvas
ok
Anyways, for your previous jimp issue, it was something wrong with your code on the message send part
msg.channel.send({files: [attach]});
message.channel.send takes first argument as the message content and the second one as attachments/embeds/files etc
so it has to be this
msg.channel.send('', {files: [attach]});
@lament rock
yup
Thank you
Np
Can someone point me to a guide or tutorial for updating my bot's server count with discord js?
#312614469819826177 good place to look
literally just install dblapi and copy paste the first 2 lines of code
You should use the official library on the discordbots api docs
I'll link it here: https://discordbots.org/api/docs#intro
pls

docs > all
yes
Yeah, just loop through all the guilds and get the names
Anyyyy help?
client.guilds.map()
hmm
Thank you guys!
Help?
awesome i was able to get my server count posted!
Now I have a log error
SyntaxError: Unexpected token )
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:537:28)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Function.Module.runMain (module.js:609:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:598:3
what do you have
can you find it by yourself?
I did.
ok
It's the closing });
sendMessage is depreciated
Just send?
yeah
yes
try to look at what this parenthesis is closing at
not up to us
I made this bot with almost no knowledge.
XD
Β―_(γ)_/Β―
knowledge will come as long as you try
I wish this was lua.
try to find where the parenthesis and the brackets are not closing properly
I like lua
You can code a discord bot in lua?
yes
i believe there's discordlua
discordia library
or use a good editor that autoinserts a closing bracket with each open bracket
banned
ok what are u using
Gliiiiiitch

@_@
smh
Β―_(γ)_/Β―
what's glitch?
a bad hosting service
for bots*
Better than horiku
its not bad for express apps
ew sepuuku
what's bad about it?
So is there no way to fix this if i'm using glitch?
that has nothing to do with fixing lol
oof
you are just missing a }
^
ye
i give free hosting to tiny bots for the luls
o nice
Now I have unexpected end of input or whatever
kek
SyntaxError: Unexpected end of input
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:537:28)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Function.Module.runMain (module.js:609:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:598:3
ok here is what to do
code your bot in a proper code editor
then copy paste that code into glitch
but i'm on reeeeeing chromebook ;-;
cant you download vscode on a chromebook
what distro does chrome os run on
chrome os
^
π
google os?
o wait
well rip vscode
i misread
so you know how Ubuntu is built on Debian and fedora is built on redhat
what is chromeos built on
Idk
chrome os is literally built on top of chromium framework
Chrome OS. Chrome OS is an operating system designed by Google that is based on the Linux kernel and uses the Google Chrome web browser as its principal user interface. As a result, Chrome OS primarily supports web applications.
like, google chrome is in itself a sandbox operating system
wiki says linux kernel
or almost one
does chrome os have a package manager
nvm
latest chrome os can run linux apps
chrome os can get vscode
can it?
yes
o nice
Thank god for dev mode
time 2 powerwash
try using curl
kk thanks
and if there's a package manager then do something like apt install wget or something
-o not -0
Nope
huh
idk
done installing?
lmao
The whole thing is covered in problems
99 missing dependencies in linux, 99 missing dependencies in linux. apt-get one down, install it around. 137 missing dependencies in linux
lol
how do you get the latest commits off a github repo?
idk
pull?
Because you need to input a user id ofc 
who do you want to check if he has voted?
if its the person using the command, then you have to get their id and put it there
What I want is a voter-exclusive command
then thats what you have to do
How do I get the id of the user that has voted?
- user types in command
- bot gets command
- bot checks user id
- bot checks if used id has voted
- result if yes or if no





