#development
1 messages · Page 404 of 1
did u try doing that same thing but in ur code
Ok.
oh now it works
Ok, so I'm trying to get my bot to DM users when they upvote
if (voted) client.users.get(`${voted.user}`).send(`${voted.user} ha votado lmao!!`)
});
this is my code
but obviously it's only checking for a specific ID
Webhooks are your answer
tru
client.users.get(`${voted.user}`).send('Thanks 4 voting')
});
so this should work
amirite
yes
k thx
if (command === 'mohamed') {
dbl.getVotes().then(votes => {
if (votes.find(vote => vote.id == "388456774732349450")) {
return msg.channel.send('test');
} else {
return msg.channel.send('NOPE');
}
});
}
ok so I made this command to test this
even tho I voted it seems like not
because it always says 'nope'
(and that's my user ID)
how would i add a 5 second cooldown to a command
const votacion = new Discord.RichEmbed()
.addField("¡Gracias por votar al INDIBOT!", "¡Ahora tienes acceso al comando *españa! ¡Pruébalo tu mismo!")
.setColor(0xf47442)
.setThumbnail('https://discordbots.org/images/dblnew.png');
client.users.get(`${vote.user}`).send({embed: votacion})
});
So I did this to DM a user when he upvotes the bot
but no DMs or anything
Why are you using a template string for that?
please use hastebin/a paste service instead
anyone knows a good way to check if a user has a manage server permission from his permission integer?
@native palm because if not it literally reads that as text
and I want the bot to dm the user with the embed
@spring ember What discord library are you using? It may have something that does that for you.
no bot lib
Manual conversion.
yeah but what math property should I use?
it is supposed to be some kind of modulus right?
I still need help with this https://hastebin.com/wapodobulo.js
Maybe its because I tested it in my pc and not in a proper hosting?
maybe the port is not open
thats what I thought
Can someone test it for me? I ran out of friends online to test
lmao
test what?
upvoting the bot to see if it dms you something
sure dm me the link
@dapper olive thats what the Test button on DBL is for
heh
forgot to add webhook details in bot settings
I'll show you the result of message.guild
what?
when I upvote it
In Discord.js defaultChannel wans't deprecated
Guild {
members: [Object],
channels: [Object],
roles: [Object],
presences: [Object],
available: true,
id: '383944425648422912',
name: 'Seriumium',
icon: 'b6aa7814dc1438b3ddfe4e5bf1222eca',
splash: null,
region: 'singapore',
memberCount: 38,
large: false,
features: [],
applicationID: null,
afkTimeout: 300,
afkChannelID: null,
systemChannelID: '383947455114510336',
embedEnabled: undefined,
verificationLevel: 1,
explicitContentFilter: 2,
joinedTimestamp: 1522578768048,
ownerID: '324541397988409355',
_rawVoiceStates: Collection {},
emojis: [Object] }
This is the result of message.guild
My server
and
You can see the systemChannelID
This is same
so
defaultChannel = message.guild.systemChannelID
You can test it
dbl.webhook.on('test', test => {
console.log(`User with ID ${test.user} just tested!`);
});
should this work?
or "test" does already give vote type?
I should work if that event has properties of test.user
dbl.webhook.on('test', test => {
console.log(`User just tested!`);
});
oh fucc
ok
so I just placed that bit of code
and clicked test
and nothing is actually happening
no logs
I'm using this in a VPS
That has nothing to do with development @glossy saddle
corect
webhooks take a while to send
it was just the url I introduced in bot settings was wrong
show code and error
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
import time
import random
from multiprocessing import Process
import sys
#Here is the basic command:
#await client.send_message(message.channel, messsage)
Client = discord.Client()
client = commands.Bot(command_prefix = "")
@client.event
async def on_ready():
print ("yep... it works!")
@client.event
async def on_message(message):
if message.content == "test":
x = random.randrange(1, 2)
if x == 1:
msg = await client.send_message(message.channel, "hi")
await client.add_reaction(msg, "\u0031\u20E3")
await client.add_reaction(msg, "\u0032\u20E3")
await client.add_reaction(msg, "\u0033\u20E3")
await client.add_reaction(msg, "\u0034\u20E3")
def check(reaction, user):
e = str(reaction.emoji)
return e.startswith(("\u0031\u20E3"))
def check2(reaction, user):
e2 = str(reaction.emoji)
return e2.startswith(("\u0032\u20E3", "\u0032\u20E3", "\u0032\u20E3"))
for p in range(0, 500):
res = client.wait_for_reaction(message=msg, check=check)
client.send_message(message.channel, "yay!")
res = client.wait_for_reaction(message=msg, check=check2)
client.send_message(message.channel, "also yay!")
time.sleep(0.01)
return```
thats my code
it says this
my token is underneath that btw
@gleaming summit here's a question, what I'd a guild doesn't have a system channel?
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 38, in on_message
res = client.wait_for_reaction(message=msg, check=check)
UnboundLocalError: local variable 'msg' referenced before assignment
that
i dont get it...
how much time does a webhook take to send?
what do I change msg to?
@dapper olive about 1-2 mins
@wispy schooner You means channel can be deleted?
caching and stuff
@gleaming summit yes
I want to say something without sounding rude b/c I want to take out the new messages thing. Its triggering me for some reason
oops
//poll
if (cmd === `${prefix}poll`){
let question = args.slice(0).join(" ");
if (args.length === 0)
return message.reply('**Invalid Format:** `/poll <Question>`')
const embed = new Discord.RichEmbed()
.setTitle("A Poll Has Been Started!")
.setColor("#5599ff")
.setDescription(${question})
.setFooter(Poll Started By: ${message.author.username}, ${message.author.avatarURL})
message.channel.send({embed})
message.react('נ‘')
.then(() => message.react('👍'))
.then(() => message.react(👎'))
.catch(() => console.error('Emoji failed to react.'));
}
//token
bot.login(process.env.BOT_TOKEN);
?
show error
Guild {
members: [Object],
channels: [Object],
roles: [Object],
presences: [Object],
name: 'test',
icon: null,
splash: null,
region: 'japan',
memberCount: 2,
large: false,
features: [],
applicationID: null,
afkTimeout: 300,
afkChannelID: null,
systemChannelID: null,
embedEnabled: false,
verificationLevel: 0,
explicitContentFilter: 0,
joinedTimestamp: 1525022446268,
id: '440200686383136778',
available: true,
ownerID: '324541397988409355',
_rawVoiceStates: Collection {},
emojis: Collection {} }
@wispy schooner
Checked. My mistake. Can you tell me what is diffrent between defaultChannel and systemChannel?
Is the diffrence between two channel is automattically modifyed?
Ok, so the bot DM'd me the first time I clicked test
but it doesn't dm me anymore
and I didn't change anything
http://prntscr.com/jbnhn9 @topaz fjord
//poll
if (cmd === ${prefix}poll){
let question = args.slice(0).join(" ");
if (args.length === 0)
return message.reply('Invalid Format: /poll <Question>')
const embed = new Discord.RichEmbed()
.setTitle("A Poll Has Been Started!")
.setColor("#5599ff")
.setDescription(${question})
.setFooter(Poll Started By: ${message.author.username}, ${message.author.avatarURL})
message.channel.send({embed})
message.react('נ‘')
.then(() => message.react(':thumbsup:'))
.then(() => message.react(:thumbsdown:'))
.catch(() => console.error('Emoji failed to react.'));
}
//token
bot.login(process.env.BOT_TOKEN);
lets see
so
try?
no
plz
@uncut slate
you have to wait
kens
did u see what i said
can u hastebin whole code and send me link
and also those errors seem pretty obvious
so this is the message it should send when someone upvotes the bot
this actually went ok
but that happened when I clicked test
and doesn't happen anymore
I mean, it doesn't care how many times I click test
nothing appears
is test fixed to only 1 try?
now it works magically
just because i added a console.log

@gleaming summit there simply isn't a defaultChannel anymore, like at all Discord removed it.
@wispy schooner Always thanks
https://media.turtle-bot.com/f/xjAEO.png @gleaming summit it was deprecated
😭
How would i catch the error
so
if supportrole.id is null
i can send a message
saying to make a support role
do you mean if (supportrole.id === null)?
how would I catch the error from this when the ytd.search function finds no results
if(!supportrole)
if(supportrole.id === null) return msg.channel.send('Please make a role named `Support`!');```
hmm,
wait
This would be the proper way right?
Alright
ill try it out
Thanks
TypeError: Cannot read property 'id' of null
at Object.module.exports.run (C:\Users\jeffrey\Desktop\mustang\commands\ticketcreate.js:6:33)
at Client.client.on (C:\Users\jeffrey\Desktop\mustang\index.js:126:24)
at Client.emit (events.js:185:15)
at MessageCreateHandler.handle (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\jeffrey\Desktop\mustang\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:180:13)
at Receiver._receiver.onmessage (C:\Users\jeffrey\Desktop\mustang\node_modules\ws\lib\websocket.js:137:47)```
same error as before
do if(!supportrole)
cus with if(supportrole.id === null)
you checking if the id is null, from a thing thats null
const Discord = require('discord.js');
module.exports.run = async (client, msg, args) => {
if(!args[0]) return msg.channel.send('Why are you making a ticket? supply a reason please!');
let supportrole = msg.guild.roles.find('name', 'Support');
if(!supportrole) return msg.channel.send('Please make a role named `Support`!');
let supportid = supportrole.id;
if(supportrole.id === null) return msg.channel.send('Please make a role named `Support`!');
msg.guild.createChannel(`Ticket-${msg.author.username}`, 'text').then(chan => {
chan.overwritePermissions(msg.author, { SEND_MESSAGES: true,READ_MESSAGE_HISTORY: true,READ_MESSAGES: true })
chan.overwritePermissions(supportid, { SEND_MESSAGES: true,READ_MESSAGE_HISTORY: true,READ_MESSAGES: true })
chan.overwritePermissions(msg.guild.id, { SEND_MESSAGES: false, READ_MESSAGE_HISTORY: false, READ_MESSAGES: false })
})
msg.channel.send('Ticket created succesfully!')
}
module.exports.help = {
name: 'ticketcreate'
}```
hi
take out the if(supportrole.id)
@earnest phoenix thanks, that works well
ok cya
Doesnt change a thing
if(supportrole.id === null) => if(supportrole === null)
ok
Still the same damn error
TypeError: Cannot read property 'id' of null this error?
ah ofc: let supportid = supportrole.id;
put that line below
wait it is
Aight
your error is that the objct supportrole is null
You can't access a property of null or undefined
And even if you're doing your test, you do nothing to prevent going beyond and executing next line
Change that
That's why nothing changed
@halcyon abyss How would i fix this problem
people in the DiscordAPI discord told me to do if(!supportrole) which i told them i already tried and didnt work they told me it does work, and i proved them wrong

For example, you could do something like this
if (!supportole) {
// Here supportrole is not defined, so something like an error msg
} else {
// here supportole is defined, so do what you wanted to do
}```
I think you should read some js tutorial, those are the basics and knowing them will be really useful later
^
But
ive tried that
and it didnt work
as i said multiple times now
also
i already know those basics
and have implemented them before
ive tried these 2!
let supportrole = msg.guild.roles.find('name', 'Support');
if (!supportrole) return msg.channel.send('Make a role named `Support`!');
let supportid = supportrole.id;
if(!supportid) return msg.channel.send('Make a role named `Support`!');
And that should would perfectly
but it doesnt
instead it seems like its just being ignored
are you checking the id before the support role
im first finding the support role then getting the id
and in this case the role doesnt exist, so im trying to catch the error and send a message
I mean if its null an if(!) should work
Thats why im asking for help and being so confused
oops my bad read too fast didn't see the return.
Did you try to console.log(supportrole); to see what it looks like ?
before crashing
100% its null
how would i catch an error like this http://i68.tinypic.com/vfgjo2.png
use try{} catch{}
i did
try{
user.send()
}catch(err){
return;
}
show code then
will just do nothing if it cant send
try {
msg.channel.send("📨 Help coming in your DMs!")
const embed = {
"title": "Hey! Im Artemis!",
"description": "Here you can learn about my commands and how to use them!",
"color": 5315286,
"footer": {
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
"text": `© 2018 SamuraiStacks | v${package.version}`
},
"author": {
"name": "Artemis by SamuraiStacks. | Click here to join support server!",
"url": "cant"
},
"fields": [
{
"name": "The commands",
"value": `${commandArr.join('\n')}`
}
]
};
msg.author.send({ embed })
} catch (err) {
return msg.channel.send("❌ I don't have permission to send you DM messages! Please enable `Allow direct messages from server members` in your User Settings!")
}
for me?
no
the bot has perms to send messages in the channel
``` connection.query("truncate bot.censorbot")
connection.query("ALTER TABLE bot.censorbot CHANGE COLUMN idcensorbot idcensorbot INT(11) NOT NULL ;")
connection.query("ALTER TABLE bot.censorbot CHANGE COLUMN idcensorbot idcensorbot INT(11) NOT NULL AUTO_INCREMENT ;")
var guildList = bot.guilds.array();
guildList.forEach(guild => {
var servername = guild.name
let on = {
"serverid": guild.id,
"censor": true,
}
connection.query("INSERT INTO censorbot SET ?", on)
console.log(inserted ${guild.name})
if(guild.id == "428570175126634516") return;
if(guild.id == "438881277899440168") return;
if(guild.id == "292962760764030977") return;
if(guild.id == "437473327062450188") return;
connection.query(`UPDATE censorbot SET servername = "${guild.name}" WHERE serverid = '${guild.id}'`)
});```
is this api spamming or is it just mysql spam cuz i dont wanna get banned lmaoo
ight no api spam?
nope
17
down vote
You cannot use try-catch statements to handle exceptions thrown asynchronously, as the function has "returned" before any exception is thrown. You should instead use the promise.then and promise.catch methods, which represent the asynchronous equivalent of the try-catch statement.
alright thnx ver
ok
do bot Client IDs have a minimum and maximum value? I have a simple html widget that provides a link to the authorize-app-on-my-server page after a user types in the client ID, and I'd like to validate that value on more than just /\d+/
there all 64bit intergers i believe
what happens when it reaches max 64bit int?
well, assuming one bot is created every second (I doubt it), we'll have to wait til the heat-death of the universe 😉
develop a 128bit int
?
or is already created
just isnt in cpus
i dunno im dumb
In computer architecture, 128-bit integers, memory addresses, or other data units are those that are 128 bits (16 octets) wide. Also, 128-bit CPU and ALU architectures are those that are based on registers, address buses, or data buses of that si...
looks like im dumb
If by Client ID, you mean snowflakes. They can get longer.
1: 440270039120084993
2: 99922900592660480
1 is the id of latest message in this channel from 2018. 2 is the id of a message I sent in 2015. User IDs work the same way.
They're secretly timestamps.
they're timestamps + some info on which node generated them
should i use nw.js or electron.js?
electron
ok
How long does it usually take for a bot to get approved/denied?
1 hour - 1 week
oof
?
hi
@pearl violet
u a bot
ok
heres MY FRIGGIN PROBLEM
im tryina make a trivia bot
and heres my code
async def on_message(message):
if message.content == "tb!trivia" or message.content == "tb!t" or message.content == "tb!T" or message.content == "tb!Trivia":
x = random.randrange(1, 2)
if x == 1:
embed = discord.Embed(title="Who was the famous monk that invented champagne?", description="", color=0xff0000)
embed.add_field(name="", value="1) Somdej Toh", inline=False)
embed.add_field(name="", value="2) Dom Perignon", inline=False)
embed.add_field(name="", value="3) Mattheiu Ricard", inline=False)
embed.add_field(name="", value="4) Anselm Hurt", inline=False)
msg = await client.send_message(message.channel, embed = embed)
await client.add_reaction(msg, "\u0031\u20E3")
await client.add_reaction(msg, "\u0032\u20E3")
await client.add_reaction(msg, "\u0033\u20E3")
await client.add_reaction(msg, "\u0034\u20E3")
res = await client.wait_for_reaction(message=msg, emoji=["\u0031\u20E3", "\u0032\u20E3", "\u0033\u20E3", "\u0034\u20E3"], user=message.author)
if res.reaction.emoji == "\u0031\u20E3":
await client.send_message(message.channel, "Dom perignon is correct! Uh... no prizes. :P")
else:
await client.send_message(message.channel, "Sorry, that answer is incorrect! The correct answer is Dom Perignon!")```
but theb bot wont add reactions to embeds
and im sad
someone help?
thx
this is python async
discord bot
Does the bot have the proper permissions @hidden veldt
You should store questions in json
wat is that
nope
didnt work
gave it embeds, admin, and add reactions
i got this
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\edwar\Desktop\Bot-Lib\TB\v1.py", line 28, in on_message
msg = await client.send_message(message.channel, embed = embed)
File "C:\Python\lib\site-packages\discord\client.py", line 1152, in send_message
data = yield from self.http.send_message(channel_id, content, guild_id=guild_id, tts=tts, embed=embed)
File "C:\Python\lib\site-packages\discord\http.py", line 200, in request
raise HTTPException(r, data)
discord.errors.HTTPException: BAD REQUEST (status code: 400)
😦
what does that even mean...
:?
It can't send the message
I first started getting that error when I added msg = before the line
but I need that line
cuz it has to make it a variable to test the reactions and add then
It's not the assignment to the variable.
It's a bad request
msg = await client.send_message(message.channel, embed=embed)```Write it exactly like that...
remove the py
Remove the description="", from the embed variable aswell. Don't use empty strings
Like in the add_field
q = {1: {'name': 'Question 1', 'a': 'aa', 'b': 'bb', 'c': 'cc', 'd': 'dd'}, 2: {'name': 'Question 2', 'a': 'aa', 'b': 'bb', 'c': 'cc', 'd': 'dd'}}
@hidden veldt
embed.add_field(name="A", value="1 Somdej Toh", inline=False)
embed.add_field(name="B", value="2 Dom Perignon", inline=False)
embed.add_field(name="C", value="3 Mattheiu Ricard", inline=False)
embed.add_field(name="D", value="4 Anselm Hurt", inline=False)```
Use that
What's the best way to host a little http server with Java on my bot to accept POST and GET requests?
It's fixed?
yep its fixed
@hidden veldt
@gilded blaze idk
i dont do http or java
@floral stone
wat
uh... just a small thing
can I put A and the answer on one line?
Please look over my example that I provide to you and the code your said wasn't working. See what I changed and learn from it.
You could do it in description
trust
i dont just go here askin for spoonfeed
i looked this up for like 30 mins
i asked in other servers
that allow spoonfeed >:D
embed = discord.Embed(title="Who was the famous monk that invented champagne?", description="A. answer\nB. answer\nC. answer\nD. answer", color=0xff0000)
It supports markdown and bolding text along with custom emojis in description.
\n makes a new line
ik
\n works in majority of strings
i tried that with await client.send_message
It's not different
and it gave me like seventeen errors
post it
well it worked
post your code
No, the example you provide me was different.
yep
You should join the discord.py server if you really need help.
Sure.
Hey you should add unturned to the list of supported games for PatchBot, PLEZ. 😉
@heady marsh ask in patchbot support server
Anyone that uses .py can tell me how to do the ping command xD?
store the current time send a message. get the new time. find the difference. then edit the message and send the difference.
simple ping: just reply "Pong!"
the ping that u normaly c: get the time of the command and minus it to the time of the msg timestamp
or use bot.latency for the ws latency
@lament meteor Thats the msg response time
do what 4JR said for WS Latency (API Response)
ik
Can I use lavalink as a lavaplayer node?
Which sql thingy do you prefer for 10K sharded bot mongo or mysql?
MySQL
sqlite
postgre
mysql 
hey guys, let's say I want to send multiple messages to user on specific command
For example commandWithMultipleArgs arg1 arg2 arg3 arg4 arg5
For each argument I'll respond with a message containing info for that argument.
So following example above, in response I'll send 5 messages.
The question is, how many messages can I send before I get marked as spammer/banned?
Will I get banned if I'll respond with 20/50/100 messages?
just stop at like 4 or 5
thanks lol
iirc it's like 5msg/5s and after that it's rate limited
{ Error: ENOENT: no such file or directory, open '../../data/BOT/bots.json'
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '../../data/BOT/bots.json' }
{ Error: ENOENT: no such file or directory, open '../../data/BOT/costumer.json'
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '../../data/BOT/costumer.json' }
^C
``` code ``` var fs = require('fs');
fs.writeFile("../../data/BOT/bots.json", JSON.stringify (botFile, null, 4), err => {
if (err) {
console.log(err)
}
});```
why dosent if find the right files?
because ../../data/BOT/bots.json isn't a file
Is it your main script ?
no its one of my commands
bc i've a doubt is the path used is from the path of the main script
You know what ../ does right?
for fs
If you don't look this up; https://www.w3schools.com/html/html_filepaths.asp
yea it goes out a folder
yea because my folders looks like this /home/ubuntu/bot/commands/BOTcommand /home/ubuntu/bot/data/BOT
Yeah now I'm sure, fs use the path from your main file
Not the current script
it's not like require
ok so if i do ./data/BOT/bots.json it would work?
try this
np
OwO what's this, Windows Client does not support authentication protocol requested by server; consider upgrading MySQL client

So how do I fix the app twice thing?
İnstall /watch.json
Ok.
But I already put it in winscr
Error e4or
Wait no,
Not that error.
E404
That,
When I did npm install watch.json
So what do I do?
You make it go to watch.json
ok it launched watch.json then
Ok but the bot is still offline.
I don't understand why you'd ever want to run a json file
It's a json file
why would it run?
change to a valid token then
Yes
Maybe if you had a windows phone
idk
Otherwise I don't think so
Winscp
win = windows
Oh ok.
ok
Why?
so u trying to run node app/watch.json
its all gud?
No.
ur bot is still offline
ok
It is saying the token is wrong.

Back.
Boyss
if (!args[0]) return msg.channel.send('Why are you making a ticket? supply a reason please!');
let supportrole = msg.guild.roles.find('name', 'Support');
if (!supportrole) return msg.channel.send('Make a role named `Support`!');
let supportid = supportrole.id;
if(!supportid) return msg.channel.send('Make a role named `Support`!');```
Thats still erroring
TypeError: Cannot read property 'id' of null
at Object.module.exports.run (C:\Users\jeffrey\Desktop\mustang\commands\ticketcreate.js:6:33)
at Client.client.on (C:\Users\jeffrey\Desktop\mustang\index.js:126:24)
at Client.emit (events.js:185:15)
at MessageCreateHandler.handle (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\jeffrey\Desktop\mustang\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\jeffrey\Desktop\mustang\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:180:13)
at Receiver._receiver.onmessage (C:\Users\jeffrey\Desktop\mustang\node_modules\ws\lib\websocket.js:137:47)```
That error should be handled by the if(!supportrole) return; & if(!supportid) return; check
but it isnt
everytime i go to try again
i make sure my node process is properly shutdown
supportrole value is null
yea i know
Thats why there is an if(!supportrole) return;
which should work
but doesnt
try to do console.log(supportrole) and send me what u got
Problem solved
Im the biggest idiot in the world
Was editing my beta/dev bot
and running normal bot
SORRY for wasting time
😂
haha nice one
XD
XD
it works fine now
yea
.
How can i add something like !guilds that tells the guilds bot is in via DM or message.channel.send
tells the guild names"
^thanks

is theres a way to get all invite links of guilds with bot ?
Language?
Send announcement is against discord ToS afaik
@earnest phoenix what lib are you using
ohh
it is against TOS
then fuck it
despite the fact that it is surprisingly easy 
if you need to supply information to all people quickly, creating a support guild for your bot would be the best bet
something is wrong with my bot its going off and on
or putting the information in your bots presence
XD
hey, i'd need some help with a JS thing
guild.modroles = [];
guild.modroles = sql.prepare('SELECT role FROM modroles WHERE guild2 = ?').all(guildid);
console.log(guild.modroles);```
this returns an array of object. how can i make it return an array of strings?
current output: ```[ { role: '415602802300289026' },
{ role: '314124770302230528' } ]```
.map(x=>x.role)
thank you
if(!message.member.roles.some(r=>guild.modroles.includes(r.name)) ) return message.reply("You need a mod role to use this command!");``` this actually seem to return true even if teh user has a mod role
anyone'
?
hello plese help me . how to do webhoks? for exmple
to use //meme
bot say you must to vote !
and i read this > https://discordbots.org/api/docs#webhooks
and i need help /
Webhooks should not interest you
I didn't understand a thing
@bronze musk use dbl.hasVoted
++
Anyone know why when I package my java project into a jar it can’t find a lib, but in my IDE it can? (Using Maven)
are you packaging the lib with the jar or adding the lib to the classpath?
Packaging
doing that with the shade plugin?
Does anyone here that uses rethinkdb could help me with getting a list of values from all the documents in a table
so far this is all I tried:
Cursor<Feed> feeds = r.table("guilds").map(d -> d.g("feeds")).run(conn(), Feed.class);
it doesn't work but gives no error
how would i remove this from my bot http://i65.tinypic.com/1z645mv.png
the .361 seconds
am using humanize-duration btw
Turn it into an int not a float
fetch.post(`https://discordbots.org/api/bots/431748301839400961/stats`) 2018-04-30T22:03:28.875605+00:00 app[worker.1]: ^^^^^ 2018-04-30T22:03:28.875607+00:00 app[worker.1]: 2018-04-30T22:03:28.875609+00:00 app[worker.1]: SyntaxError: Unexpected identifier
Why do I keep getting this error
fetch.post(`https://discordbots.org/api/bots/431748301839400961/stats`) .set("Authorization", "token.DBL") .send({ server_count: emoji.guilds.size })
Java?
rethinkdb driver is shit
hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
@uncut slate Technically you could remove the cake now 😭
Thanks for all your congratulations 😄
have a nice birthday?
I had one. I'm not celebrating birthdays a lot. It's the small things that make the day great 😉
Oh damn, accidentally used the wrong channel. Sorry.
https://images.danktronics.org/images/MTxhQoXMdmIGj9NtWKeOEnRGuesAP0gNFX3Qyx1b.png why does this happen
my pom.xml seems fine
cause ur using java
https://hastebin.com/ihugadiwes.xml this is the one JDA provides 
hmm
@inner jewel still having the problem above
also if it matters I have to manually say what the main class is when i execute the command
how are you running it?
java -cp DankBot.jar discord.bot.Main
Does cp stand for child pornography 🤔
you could just do java -jar DankBot.jar
no
gets insta banned
wrong channel
no main manifest attribute, in DankBot.jar
OMHG
OMG
I GOT IT WORKING
I JUST HAD TO DELETE IT AND REDO
i don't need to specify main class either
👍
@floral stone me 😳
modify on_message
What if the normal command isn’t on_mesage
e.g: async def hi etc etc
@whatever.command()
async def test():
await whatever.say('!say help')
I mean I prevented others from using $say.
the owner of this bot was banned, but it was really popular. i cant figureo ut how to get it running again from the stuff on github, but hey, if anyone else can figure it out, you'll have a popular bot.
Hehe don't ask that here
@modest schooner i doubt its really on github to be ran
hence the "you will have to reverse or replace the enviormental variables in the code for proper results." in the readme aswell
i couldnt even figure out what to replace ngl. i just miss notsobot...
i suppose if its doable some1 might do it. afaik that bot was quite popular
@modest schooner if i may just ask, what is it that is so amazing about the bot that everyone wants it back
existing features in NSB are already present/have been present for a long time in other bots, and i feel like there is plenty of ways to replace it, without the racist jokes and shit
image manipulation commands aren't hard to add if you have an API for it
lots of bots have it 
no u
Putty is pissing me off.
I just fixed the damn token.
Now it is saying invalid token.
putty as in the ssh client?
Yes.
what token exactly
Bot token.
how is that puttys fault
Idk.

I just fixed the bot token though.
Ima do it again then.
and try node app/bot.js again.
ok
@austere meadow its image manip.
i know iti sp ossible to do that, its not revolutionary
?
i just dont know of any other bots that do that
hard code?
there is literally a tag for that in the search
scroll up, im replying to an @ savitar
lets move to shitpost so we don't disturb these guys
sorry
all good
What do you mean?
@earnest phoenix just literally do like client.login('token') rather than client.login(getConfigVar('token')) for example
the real token there
wdym
It isn't letting me paste.
have you tried shift+insert
shift+insert is the standard key combo for paste in most terminal emulators
only exception i can think of is windows cmd
Erm where is insert?
top-right of most keyboards
that would be the left
other side
end?
above it to the left aswell
surely you have a key somewhere labeled "ins" or similar
diagonal to your F12 key
i've never seen a keyboard without an insert key
Nope.
I have Insert near my delete button
How??
using a cell phone or something?
lol ok
insert/Defil
you probably have to press a function-lock key of some kind to switch it to insert

what in the world are you trying to do
Get my damn bot on.
cant get his token to work i told him to hard code it into the bot and this happened

....ah
anyways gotta go school now peace
Yup 0 experience.
Permission to download stuff like sudp?
sudo?
If that is what you are talking about no.
i mean do you have a means of transferring files between your own computer and the vm?
I think so yes.
sudo is a command to run another command with full perms
digital ocean should grant sftp access
right, so here's my proposal
set up an instance of the bot on your own machine and ensure that it runs properly
then transfer the entire install to your vm
(use pm2)
that way, you forego having to learn how to manage unix-like systems for the time being
Will that get my bot online?
you should eventually learn at some point in the future since it's an essential skill but for now, we just want to get the bot running
it should
Ok.
at least try to get it running locally
Instance?
What does it mean by instance?
it means the bot
like an install of the bot ig?
Oh ok.
Oh I already did that.
does it run
Wassup
If you mean gets online then no.
talk dev related stuff here.
ok why not
Idk
run it and screenshot the error
When ever I type ```code
node app/bot.js
A error shows up.
show me the error
Ok.
Error: Token is invalid
I fixed the token though.
Was going on
u didn’t
@earnest phoenix check ur token in https://discordapp.com/developers/applications/me/
do it again
check if your running the correct file
Umm I made a file in winscp named .env and put the token.
ok
and in ur <CLIENT>.login(process.env.token) or something like that
i use eris
I don't
it’s better
eris best period
eris is gud at X but bad at Y and..... d.js is gud at Y but bad at X so just shatp complaining
they are the only 2 gud js libs
good point
discord.io and discordie is outdated
Isn't ie lua
So umm how do I fix my bot???
@toxic oracle discordia is lua discordie is a rlly old lib
I'm wondering, what are the defaults about d.js ?
wat u mean?
Ah
it hasnt been updated for a year
d.js?
iirc the endpoint is still like 1-5
d.js was updated a couple months ago I believe.
@earnest phoenix
- check if your running the correct file
- check the file you are running is the
<CLIENT>.login(process.env.token) - try and c if your loading the wrong file and stuff
i was talking about discordie not d.js
d.js is using gateway v6
aka the lasted
node server.js and node app.js are you sure that app.js is the correct file not server.js
Ok.
i was gonna say that
All of it
glitch yay best host
Show the bottom of the file
where is the token
Run npm i dotenv
[Command("adduser", RunMode = RunMode.Async)]
public async Task AddUserAsync()
{
var user = Context.Message.Author;
await UserExtensions.SendMessageAsync(user, "To Continue, Please Enter Your Platform *[ pc | xbl | psn]*");
var response = await NextMessageAsync();
if (response != null)
await ReplyAsync($"You replied: {response.Content}");
else
await ReplyAsync("You did not reply before the timeout");
}
im trying to make it so that it gets the users pm response to the bot, but its not working.
And in the top of the file, add require('dotenv').config()
@toxic oracle thats not .env works
?
in ur .env do you have
TOKEN=ODYxNzE4Nzc0NTEyNDUwMTQ4.N8lYVM.vytTJTXtRyqO8VfwefGD2UqHZLO
Yes but different token.
@toxic oracle check #commands lmao
are you sure the token is right
show me the token
We honestly can't help at this point because we don't know your infrastructure/code in and out
how does .env work ? don't see any line of code where it is get and read
.env loads itself
..
does it work?
Still not working.
u have a watch.json?
Yes.
you c where it says "throttle": 90000
Yes.
add a number then remove the number
Delete one 0 and add it back?
ya
does it work
No.
.ping

