#development
1 messages · Page 352 of 1
same
it isnt my bot, but im getting this on two different bots now:
https://pastebin.com/6PqNbRk4
something called video_info is null
another red user 😄
i suspect you're trying to look up a nonexistent video
im trying to find one that does what i want xD
so far this one cant even play so its going well.
im after something that will auto play previously requested songs. Then bump new requests to the front
ahh
ie, if no ones requested anything, just play something from previously requested. Else, play the recent requests
and nothing seems to do that
so you want a bot that will just play music randomly basicly, if it has been queued before right?
you mean you want it to play continuously?
yeah
nobody's insane enough to write a bot that does that
continuously, although i dont mind it going silent if no one is in channel
just make a playlist on youtube and stack the hell out of it and do shuffle and repeat
xD
yeah lol
it would be too intensive to continuously play music on a bot with a large userbase
you're probably better off writing your own bot or modding an existing one
im looking at self hosted ones for that reason
yeah im on 200 servers with my bot nemu and she laggs if i have that setting, have you taken a look at Fredboat?
yeah i might mod/code something just hoping something had it out of the box
and no i havent. Will look now ty.
from what i know off right now fredboat can play livestreams
latest commit in a folder im looking at
" Proper usage of the BrainfuckException"
bodes well already 😄
did you get the link i sent you?
java too, would make it easier for me to hack something together than trying to figure python out lol
yes, ty, was looking at the docs
your allowed to change fredboat selfhost around
then went to their github
actually looks pretty good.
looks a good baseline for me to add the small functionality i want.
yeah its not a bad bot
flicking through the code files it isnt coded like ass so, good start.
my new bot called six is fredboat clone
im used to coding in c# but i should be able to cobble some java together xD
copy pasta stack overflow 😉
java's kinda easy lol
easier than me understanding python at least. More of a chance going c# -> java than c# -> python thats for sure
yep
awesome, thanks for this. going to have a crack at it 😃
np yw
Hmmm
looks like a bot i already have on my server might do it
if i kick of a queue and add a song to it, i can set that queue to repeat
anyone plays a song, it adds to that queue (even though the docs say it shouldnt)
and it puts it to next, so, perfect.. unless someone clears the queue
okay now that I've created many side commands, lets get to my bots core functionality
xD
anyone good with music in d.js?
what are you trying to do specifically
pause
but
the dispatcher/server.connection is not letting me run any functions on it
what do you mean by "not letting me run functions"
does it throw x is not a function or
so I would just do msg.member.voicechannel.connection.dispatcher.pause()?
voiceChannel
TypeError: server.connection.pause is not a function
@umbral pelican yeah, typo 😃
no, it's on VoiceConnection#dispatcher
connection.dispatcher.pause()
assuming the bot is in the vc, yeah
but you should note the "stream may still progress however" in the docs for pause
ok i hit a wall. >.<
do tell
ahh you are usind discordpy
it's discord.Bot in discordpy iirc
nah i dont
yes
and your code imports it?
ew python
import os
import sys
sys.path.insert(0, "lib")
import logging
import logging.handlers
import traceback
import datetime
import subprocess```
pushs to another file
well you are right i dont see discord.Client
import asyncio
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.content.startswith('!test'):
counter = 0
tmp = await client.send_message(message.channel, 'Calculating messages...')
async for log in client.logs_from(message.channel, limit=100):
if log.author == message.author:
counter += 1
await client.edit_message(tmp, 'You have {} messages.'.format(counter))
elif message.content.startswith('!sleep'):
await asyncio.sleep(5)
await client.send_message(message.channel, 'Done sleeping')
client.run('token')```
.<
Have you used discord.Client or discord.Client() ?
Or atleast the part where the error might be
ok
How can I move the div class shapes-background shapes-1 up on discord bots?
oo wait
what?
import discord
lol
You don't have it?
yes its in my settings.py
from .dataIO import dataIO
from copy import deepcopy
import discord
import os
import argparse
see
ok
same error
File "six.py", line 10, in <module>
import discord
File "C:\Users\alyzz\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\__init__.py", line 20, in <module>
from .client import Client, AppInfo, ChannelPermissions
File "C:\Users\alyzz\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 42, in <module>
from .voice_client import VoiceClient
File "C:\Users\alyzz\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\voice_client.py", line 59, in <module>
import nacl.secret
File "C:\Users\alyzz\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nacl\secret.py", line 19, in <module>
from nacl.utils import EncryptedMessage, StringFixer
File "C:\Users\alyzz\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nacl\utils.py", line 17, in <module>
import six
File "D:\Six.py\six.py", line 14, in <module>
from discord.ext import commands
File "C:\Users\alyzz\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\__init__.py", line 13, in <module>
from .bot import Bot, when_mentioned, when_mentioned_or
File "C:\Users\alyzz\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 146, in <module>
class Bot(GroupMixin, discord.Client):
AttributeError: module 'discord' has no attribute 'Client'```
i dont think i have discord.Client
.<
class Bot(GroupMixin, discord.Client):
do class Bot(GroupMixin, bot):
since it's already set
class Bot(commands.Bot): thats my class for Bot
File "C:\Users\alyzz\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 146, in <module>
class Bot(GroupMixin, discord.Client):
Can you show me some of these lines=
oh in there lol
also, you have class Bot twice?
nope
class Bot(GroupMixin, discord.Client):
lol its the same
oh ic the issue
nvm
xD
👍
Hello, i have a problem, i dev from javascript.. node.js.. but my code is not good
Also, i have a problem from json
bot.on("message", message => {
if(message.content.startsWith(PREFIX + 'si')) {
message.channel.send({embed: {
color: 0x868080,
author: message.author.username,
title: "Voici les Informations du Serveur : " + message.guild.name,
description: "**>-•-<**",
fields: [{
name: "ID : ",
value: message.guild.id,
inline: true
}, {
name: "Créateur : ",
value: message.guild.owner,
inline: true
}, {
name: "Localisation : ",
value: message.guild.region,
inline: true
}, {
name: "Membres Présents:",
value: message.guild.memberCount,
inline: true
}, {
name: "Création le : ",
value: message.guild.createdAt,
inline: true
}]
}});
}
});```
This code is not good
The message error is : converting circular strucutre to JSON
And i dont know wat this
can you help me ?
yeah
Yep, you need to change it
I do not understand anything about doc
er
so when you create the field { name: "Créateur : ", value: message.guild.owner }
i expect you think message.guild.owner is a string
ah
it's, uh, not a string
message.guild.owner.username
right
i think somthing is wrong with my discord.py
i think your author object is incorrectly formatted as well
it's supposed to be ```js
author: {
name: 'foo'
}
or something
but me is : author : message.author.username
i think it's a problem 
ah
modifie tous tes trucs en example
author: {
name: 'foo'
}
ok
un peu comme
}, {
name: "Localisation : ",
value: message.guild.region,
inline: true
}, {
name: "Membres Présents:",
value: message.guild.memberCount,
inline: true
}, {
this is correct ?
author: {
name: message.author.username,
},
mais pour
color: 0x868080,
author: message.author.username,
title: "Voici les Informations du Serveur : " + message.guild.name,
description: "**>-•-<**",
commeça
author: {
name: message.author.username,
},
mmh jpense ou pas cher aps @earnest phoenix
fait pareil que celà
}, {
name: "Localisation : ",
value: message.guild.region,
inline: true
}, {
name: "Membres Présents:",
value: message.guild.memberCount,
inline: true
}, {
mais wa
t
j'ai fais ce que vous avez demander
et ?
if(message.content.startsWith(PREFIX + 'si')) {
message.channel.send({embed: {
color: 0x868080,
author: {
name: message.author.username,
},
title: "Voici les Informations du Serveur : " + message.guild.name,
description: "**>-•-<**",
fields: [{
name: "ID : ",
value: message.guild.id,
inline: true
}, {
name: "Créateur : ",
value: message.guild.owner.username,
inline: true
}, {
name: "Localisation : ",
value: message.guild.region,
inline: true
}, {
name: "Membres Présents:",
value: message.guild.memberCount,
inline: true
}, {
name: "Création le : ",
value: message.guild.createdAt,
inline: true
}]
}});
}
});
mmmhhh 
Nope
nope
author: {
name: message.author.username,
},
ça cpas mal ça ^
mais continue pour les autres
er are you sure about that @earnest phoenix
docs indicate "author" is an author object
euh
example
ExampleAuthor: {
LeNom: "TonTruc",
}, {
MAIS WAR
@glossy sand ah !
Vous me compliquez la vie la "-"
@glossy sand help them i'm a dev for python not js
google translate x)
xdxd
i don't know.
@earnest phoenix rip demande à un autre 
yey
How can I use message author's avatar in embeds?
It gives "Not well formed URL" error
language / library
discord js
image: {
url: msg.author.avatarURL
}
Can I do it in rich embed?
that is a rich embed
How can I see the guild owners name and discrim without mentioning them?
programmatically, you mean?
I guess, I have a guild log channel but it mentions them. It often looks weird and only mentions people sometimes. Therefore I want just a name and discrim. The bot sends an embed when it joins a guild
you could just not include the @
I mean I don't entirely understand your issue
you're trying to output username and discrim but it's causing the users to be tagged?
No, I want the username and discrim, but when I try to it says undefined#undefined
If you have a command to have the logs of a bot that joins the servers tell me! (The bot sends a message with the info of the servers in a channel)
Yeah
it should be as simple as ${guild.user.username}#${guild.owner.discrim} right
guild.user?
er, owner I mean
xd guild.user.username
actually no I'm wrong
?
you'll have to ${guild.owner.user.username}#${guild.owner.user.discriminator}
GuildMember wraps User instead of extending it
Oh ok
kind of annoying
if you wanted to though, you could extend the prototype of User for convenience
User.prototype.toUserDiscrim = function() {
return `${this.username}#${this.discriminator}`;
};
then you would be able to just call guild.owner.user.toUserDiscrim()
Yeah
eh too used to java
no u
No u
no me
My. Mute. Command. No. Work
( yes
For a test bot
I copied someones mute code from somewhere
I want to see if it works
First of all that's your kick command. And guildMember shouldn't be there
hmm
No not really
Yeah
but it works now still
I dont want my bot to get kicked if its offline for long :D
It wont if its off for like a day or two
Yeah
Maybe put // in front of every line of that command
to make it inactive
and then launch the bot
Can someone help me? I'm trying to make this extend all the way to the edge. (html and css)
@quiet bobcat i deleted it
That works too lol
i can find another dev who can help me in 2 days
Shouldn't this work .addField("Joined at: ", message.author.joinedAt)
joinedAt.toString()
@quiet bobcat "Maybe put // in front of every line of that command" or just do /* in one line and */ in the other 

😹
when you tag the wrong atmg
I wanna directly get connection from the website to the bot - and be able to access all data
I'm making a control panel
oh I can help with that
anyway, are you gonna host the site on the same machine as your database(s)?
No
I think that's a bad thing
Since that means you want to read others' message
But yes, you would have to use either Discord API or make your own API with the bot
That's not what I'm using it for

I just wanna have access to the bot, the way I have access to it in my code - but on my website

"access to the bot" explain
I thought by that, you meant checking all servers he's inside, check their messages, etc
you'll have to make an API
Reeeeee
Shouldn't be hard
@thorny hinge 1. have the bot script host a http server
Ay so do i 😛 gives you really good control of content with response to what the bots upto
no matter what I do the servercount thing isn't working
what lang?
async def on_ready(self):
await aiohttp.ClientSession().post('https://discordbots.org/api/bots/' + str(self.user.id) + '/stats', json={"server_count": len(self.servers)}, headers={'Authorization':
dbltoken})
(I've tred like three different things from #312614469819826177)
py
i can see that
from the thing you send
@hallow wing you haven't defined dblToken
that is supposed to be the token from your bot page on DBL
it's defined elsewhere
ah
why not start simple and start with JSON and expand later to a DB
async def on_ready(self):
await aiohttp.ClientSession().post('https://discordbots.org/api/bots/my_bot_id/stats', json={"server_count": len(self.servers)}, headers={'Authorization':
dbltoken})```
where my_bot_id = your bots id
if you don't know that out of your head just head over to your bot page 😉
or I can just right click and grab it to xD
okay
async def dblpost(self):
"""
This async function does a post of server and shard count to discordbots.org.
"""
if self.config['dbl'] != "":
headers = {
'Authorization': self.config['dbl'],
'Content-Type': 'application/json'
}
data = {
'server_count': len(self.bot.guilds),
'shard_count': len(self.bot.shards)
}
i = await self.bot.application_info()
req = await self.bot.session.post(f'https://discordbots.org/api/bots/{i.id}/stats',
data=json.dumps(data), headers=headers)
if req.status == 200:
logging.info('poster[dbl]: done')
else:
t = await req.text()
logging.error(f'poster[dbl]: oops (code {req.status})')
logging.error(f'poster[dbl]: response: {t}')
else:
pass```
try this
I don't have shards but oki
¯_(ツ)_/¯
for the future
make stuff future proof
always help in the later stages/run
if you don't have shards it will just give 1
o.o I could never see neko on 1000 servers let a alone 2000 which is when you need to start sharding
oh?
it goes fast
It's better to be prepared
^
If I was you I would start sharding at 1K
same
It doesn't shard, now, but it can if needed
i already am sharding 
yeah
And if you use discord.py rewrite you can just use the AutoShardedClient
Which seems nice
on async sadly
with Eris it's almost the same
There is an async2rewrite converter on pip
What lib do you use Winter?
^
I used that and checked any things I need to change
I'm not gonna switch back anymore
so I don't think I have logging
so I changed it to print
that should still work rihgt?
yeah
iurhgfuesdsgdsa
FUCK IT
DISCORDBOTLIST DOESN'T NEED TO KNOW HOW MANY SERVER'S I'M ON
I KNOW AND THAT'S ALL THAT MATTERS
maybe
agh
ikkk
I'm recoding from scratch soon
but I was trying to get this done first
guess I'll have to get certifed after re-write
maybe
damn
k
hi
if anyone have a command for bot log guild on join tage me, i need a command for the logs example (If my bot join a guild my bot send a message in a channel in my server with all infos guild)
idk if you understand
@client.event
async def on_guild_join(guild):
if system_channel is not None:
await guild.system_channel.send("Your info here")
else:
guild.text_channels[0].send("Your info here")
I think this should work
Basicly
When bot joins guild
don't spoonfeed
https://discordpy.readthedocs.io/en/rewrite/api.html#event-reference read this for more
@quasi marsh ok so i add example server.owner.user.name or other ?
ok thanks
It depends if you use rewrite (which i recommend) or async
rewrite has a lot more features but is "technically" unstable
http://prntscr.com/hpocjx Basicaly i'm using discord.js but i dont get how peole do this like adding the image and text is it a npm i tried the canvas npm but its really hard and i couldn't find a tutorial or something on youtube is there another way?
Stackoverflow 
when you need a youtube tutorial to use an npm package
canvas is pretty similar to https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API
just in node
and not a browser
just read docs you dont need a tutorial
what
How to make a bot to send a dm to a specified thats not in the guild where the command was executed in? JavaScript - Discord.js
@earnest phoenix 1. Puhu englantia 2. Sun pitää lähettää servercount meidän apiin, katso #312614469819826177 ja https://discordbots.org/api/docs
I have this problem that the shapes in the background doesn't reach the edge. Anyone know why and if so how to fix it?
lol
mmm background shapes memes
ikrr
ur a background shape meme
ooooh... hard one right there 😹
Is there a way to do this module.exports = message => {} but with more.. arguments? like module.exports = message, ready => {}
I'm trying to get it to give me a list of people who have upvoted my bot https://discordbots.org/api/bots/363695248997613575/votes but i'm not sure how to do it with the api key and stuff has anyone got a example so i just want it to console.log the result of the page but im not sure how i would get past auth
I have this so far js request('https://discordbots.org/api/bots/363695248997613575/votes', function (error, response, body) { .set('Authorization', key) var ParsedBody = JSON.parse(body); console.log(ParsedBody) }); key is defined as my api key
if i remove the .set i get unautharized
how do i set it
you need to set it before the callback
So if I have this string: hello hello hello, how can I get all the "hello"'s and access each one with an array like hello[0] or hello[2] 
'hello hello hello'.split(' ');
hi
amtg weren't u the one asking for an api?
Yeah yesterday
den dm
What
How to check for dead shards
The word im trying to find is not actually hello
?
you can
let str = 'hello hello hello';
let m, arr = [];
while (m = /\bhello\b/g.exec(str)) {
arr.push(m[0]);
}
console.log(arr); // => ['hello', 'hello', 'hello']
,anyone?
you can also do something stupid with replace like
let str = 'hello hello hello';
let arr = [];
str.replace(/\bhello\b/g, function(m) {
arr.push(m);
});
@earnest phoenix want to see the code?
Sure
@topaz fjord yh
wut
Yo can anyone help me with this white space at the bottom of my page?
(The red boxes highlight elements)
(The body element has the background set to well, the giant image)
Apparently the white space isn't in the body 
(This is when zoomed out ^)
Hey does anyone know of a node.js library that would allow me to post the number of servers my bot is on?
Oh lol thanks
@earnest phoenix https://hastebin.com/aboluyuwam.js
the pay command thats given me problems
and mysql is the worst place to start
I suggest you do it ASAP before you get any serious data
MONGO
YOU WOT
YOU WOT
MONGO
why its adding wonky af
so
when i first do my pay command and pay someone 1k it gives them 3k instead
then i pay them 1k more
and it takes 1k from them
its being wonky for some reason
LOL
wait
heres a better example
of it being wonky
and yes
it did add 10000 to me
Try adding again and then tell me if everyone got the amount you added
how did it jump from 1k to 13k 
it looks like that is what just happeendf there
ok
i tried to pay the same person again
and it wont even give them the money anymore
Try your add command to give a user money and see if it adds that amount to all users
In that screenshot it looks like it is doing that
I have not one clue, make sure all your variables for the numbers are not strings and that the numbers in the database are numbers.
Make sure you're fetching the correct user from the database, and make sure you updating the correct user in the database
I hate mysql personally, so I cannot help on that side of things.
Try logging the results entry and see if the amount is a string or an INT because that would matter as well.
Alright, so everything works now?
settings.query(`UPDATE eco SET money = ? WHERE userID = ? AND guildID = ?`, [results[0].money + payamount, user.id, message.guild.id])
settings.query(`UPDATE eco SET money = ? WHERE userID = ? AND guildID = ?`, [rows[0].money - payamount, message.author.id, message.guild.id])
its was here
int(results[0])
instead of putting results[0] u put rows[0]
WHATEVER
No reason
trying to get everything ready before big update
My name?

(C:\Users\siddh\Desktop\TurtleBot-Dev-Release\bot.js:35:23) Parsing error: Unexpected token =>
Error: (C:\Users\siddh\Desktop\TurtleBot-Dev-Release\bot.js:35:23) Parsing error: Unexpected token =>
at getSourceCodeOfFile (C:\Users\siddh\AppData\Roaming\npm\node_modules\eslint\lib\util\source-code-util.js:38:15)
at filenames.forEach.filename (C:\Users\siddh\AppData\Roaming\npm\node_modules\eslint\lib\util\source-code-util.js:94:28)
at Array.forEach (<anonymous>)
at getSourceCodeOfFiles (C:\Users\siddh\AppData\Roaming\npm\node_modules\eslint\lib\util\source-code-util.js:93:15)
at configureRules (C:\Users\siddh\AppData\Roaming\npm\node_modules\eslint\lib\config\config-initializer.js:165:23)
at processAnswers (C:\Users\siddh\AppData\Roaming\npm\node_modules\eslint\lib\config\config-initializer.js:288:18)
at inquirer.prompt.then.secondAnswers (C:\Users\siddh\AppData\Roaming\npm\node_modules\eslint\lib\config\config-initializer.js:536:32)
at <anonymous>
Determining Config: 0% [------------------------------] 0.1s elapsed, eta 0.0s
one other thing
im kinda having problems with eslint
code?
C:\Users\siddh\Desktop\TurtleBot-Dev-Release\bot.js
there's code
unless bot.js is now a meme?
So when I do a forEach and run into an error with one of the elements, how can I like uh.. see how many errors I ran into?
An example:
[null, "kek", 2].forEach(element=> element.slice(1))
2 of those elements will fail, but how can I make it automatically count how many elements failed
there's no built-in way to do it
but you can keep a counter and use try...catch blocks
let counter = 0;
arr.forEach(thing => {
try {
// do something
} catch (e) {
counter++;
}
});
console.log(`${counter} things went wrong!`);
or you can do something stupid like
let failed = arr.filter(thing => {
try {
// do something
} catch (e) {
return true;
}
return false;
}).length;
there's always a stupid solution in js
kek
counter things went wrong 👌
huh
i tyring to think of new webdev projects or just projects overall to work on
if anyone got some neat ideas but dont have time ect to do it hmu
im bored as all hell
i work in the MEAN stack if it isnt obvious and play with stuff like sockets often if that helps
hey
can someone help
I have
(node:4) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Cannot send an empty message
2017-12-20T12:25:12.881945+00:00 app[worker.1]: (node:4) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2017-12-20T12:25:13.025983+00:00 app[worker.1]: message deleted -.
2017-12-20T12:25:13.084845+00:00 app[worker.1]: [ '' ]
2017-12-20T12:25:13.084893+00:00 app[worker.1]:
2017-12-20T12:25:13.084947+00:00 app[worker.1]: []
2017-12-20T12:25:13.108478+00:00 app[worker.1]: (node:4) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): DiscordAPIError: Cannot send an empty message```
error
you are trying to send an empty message
show the code
all
do you even know how to debug
not much
use breakpoints
no, this should not break your bot
but tells the debugger to wait there

check pinned messages
lul
how do I do the mention prefix
hey
aretheeryx
it doesn't work
nothing happens
no errors
🤷
can someone help me, i have visual studio 2017 on my computer but there is no .NET Core 2.0 only .NET Core 1.1
what does that mean
client.user.setPresence({
status: "online",
activity: {
name: "Donut: Rainbow Six",
type: 0,
url: "https://www.twitch.tv/discorddonut/"
}
})```
this is what i did in the ready event
BananaFace, try to look in the updater (when it is updated :P), otherwise: https://www.microsoft.com/en-us/download/details.aspx?id=19988
or the 64 bit version: https://www.microsoft.com/en-us/download/details.aspx?id=15354
@shrewd field you even know what your doing?
@quasi eagle ^
yea i already installed that
but there is an update for visual studio so ill try that first before doing anything more
👍
yea the updater is now updated
Thanks for keeping me updated on the updating of the updated updater updates always welcomed
hhehe
xD
oooo the updated updater is fetching the .NET Core sdk update to apply to the updated visual studio
Anyone know how to check for dead shards
what lang?
Js
:(
Idk about dead shards
Fuk
Shards that don't respond
The way I did it in my own bot is I have earch shard update a record in a database, I can then compared the timestamp to the current time, if it's older than a minute I assume it's dead.
You could create a websocket between the shards that allows them to poke each other to see if they're online tho, that would give you a faster response rather than having to wait for the update to happen in the database.
But then how do you fix it?
Depends on why they died
Thats the stuff I update the database with atm, and currently I'm just using an auto restart script
so in the event the bot crashes it will terminate itself and boot itself back up after a few seconds
error catching
/*
Avoid your bot from crashing on any errors
*/
process.on('unhandledRejection', error => console.log(`unhandledRejection:\n${error.stack}`))
.on('uncaughtException', error => {
console.log(`uncaughtException:\n${error.stack}`)
process.exit() //better to exit here.
})
.on('error', error => console.log(`Error:\n${error.stack}`))
.on('warn', error => console.log(`Warning:\n${error.stack}`));
So like doing this
I wouldn't kill the process just because you got an unhandled exception :p
Should I kill on error?
If you get an error, just log it somewhere and keep going, if the bot crashes because you didn't catch some error, you can auto reboot it with a small script
Naah
As an aside btw, I use https://sentry.io/welcome/ for saving crashes, exceptions etc
It's a pretty nice free tool
Is there an eval for killing a shard?
What do you mean?
Like if a shard is unresponsive, could I eval something to auto reboot ot
It
Like if I have 2 shards
And shard 1 is unresponsive
Is there something where I can eval on shard 2 to kill shard 1
If it's not responding it would be difficult to run an eval command, using auto-reconnect features from the library you're using should be fine tho.
You could close and reopen a shard via another shard, just having it auto reconnect if it disconnected would be a lot easier tho
In the event that the bot actually crashes you can have a script auto restart it, otherwise there are no need to over complicate things.
maybe multithreading ¿¿
1 thread is the bot itself, other thread looks over thread 1 to see if is death or not ¿¿
supervisor
Can someone help me? I'm getting this issue that it says this: ```javascript
if (server.dispatcher) {
^
TypeError: Cannot read property 'dispatcher' of undefinedBut it's defined the line above that asjavascript
var server = servers[message.guild.id];```
It's discord.js by the way
servers[message.guild.id] is undefined
Have a friend that posts Tading signals on his discord server i want to duplicate those messages into my own server. Is there a bot for this?
dont mind tipping someone some BTC for the help
You're coding a music bot? If you are head over to "Coding with Storm" and check out their examples and tutorials
As said before I'm using discord.js and not C#
Can someone explain to me what my URL redirect should be to get message.read to work
Well it was until I updated it
C#
What URL redirect should i use if i want to use the message.read scope!
for the AUth link
Why do you want that scope?
Oh no
Because i want to read my friends messages and paste it onto my discord
That's a bit privacy invading m8
Yeah
thats not why
so its a news discord
we do articles
He posts mine i post his
its not like that we just want to have a bot to post eachothers so we dont have to copy and paste sort of thing
Violation of ToS 
Why doesn't he just send over his article lol?
Oh you could just have a bot with !postarticle <url>
Because he has to be on at the exact same times and we on different time zones
you don't need oauth scopes for that
Fk timezones they suck
Yeah you need to use a bot
You could have your bot in UTC, and specify a time to post
.toUTCString()????
Problem is basically i need to read the messages off of a public discord server channel and duplicate them into mine do I have to use message.read
No
what can I use instead
Bot's can read any message as long as they have access to the channel
You need to make a bot and use the bot scope
Look up some tutorials online to learn to start coding
could use a bot + webhooks
to have same name and avatar as your friend
on your channel
and vice versa
Assume i couldnt put the bot on both servers what then
then give up
there's no point in paying someone to make the bot
if you can't add it
to the servers
True unless you keep it to yourself or post a link to it lol
so yeah basically useless
If you guys give me advice on how to do this i can transfer BTC
im really keen to get this working tonight
I wan't to make so the bot sends a message when it's not in a voice channel. But when I try to do that I just get ```javascript
if(server.dispatcher === 'undefined') return message.channel.send("I'm not in a voice channel!");
^
TypeError: Cannot read property 'dispatcher' of undefined``` because the bot isn't in a voice channel.
That's hydrabolts testing code lol
Anyone good at discord developement would be keen to give me some advice. I will tip bitcoin or paypal if you like
Which wrapper?
Candy wrapper kay im done 
Do you guys know what trade signals are?
Hello , this code is not correct because i want the message send pm a guys from warn .. beacause this message send mp from me..
Can you help me ?
bot.on("message", message => {
if(message.content.startsWith(PREFIX + 'warn')) {
if (!message.member.roles.find("name", "Warn")) {
return message.channel.send("Vous avez besoin du rôle **Warn** pour utiliser cette commande.")
}
let args = message.content.split(" ").slice(2);
var member= message.mentions.members.first();
let reason = args.join(" ")
message.member.send(`Vous avez été averti. Pour la raison suivante : **` + reason + `**. Dans le serveur : (**` + message.guild + `**).`)
}
});```
I want the message to be sent to the person who was warn
you sending the message the use that has sended the message
yeah but i don't want this
look at this line javascript message.member.send(`Vous avez été averti. Pour la raison suivante : **` + reason + `**. Dans le serveur : (**` + message.guild + `**).`)
yeah
tell me what is does extractly
im not drunk, he needs to see it self
the member is me because is it " var member= message.mentions.members.first();
"
If this error hasnt been fixed by the time I'm on my computer I'll post my code to warn other's
i give you a hint
there is "message.guild" ?
message.member.send
this will send a message to the user FROM the message
so me
yes, because you have send that message
so
you are also creating a variable that is been unused
(** + message.guild + **).)` this is incorrect as well
@tawny lava me is good
@north fog AH
did you solve your problem ¿
So can i read 1 at member ?
Yeah
and i guess it needs to be send to that user that you mention
yeah
other wise the bot doesnt know what to send
but
i read this
Vous avez été averti. Pour la raison suivante : + reason +. Dans le serveur : (+ message.guild +).
so he can ?
Da fuq google translates
@earnest phoenix yeah
this is not a problem
@north fog and ?
1 sec, also busy in rl
i wish i had food
he is at internship
Confuzzled
but its really easy to solve, you are currently sending a message to the author of the message, but you want to send a message to the use from the first mension, so change message.member to <something else> and you really should use the unused variable otherwise you have to remove unused things, it makes the code a mess
im litterly telling you to replace it with member because that is the user you mention to warn
and currently the variable member is been unused
ah
so i remplace member = memberone ?
(yes im so idiot)
We all learn code at our own pace
your codejavascript bot.on("message", message => { if(message.content.startsWith(PREFIX + 'warn')) { if (!message.member.roles.find("name", "Warn")) { return message.channel.send("Vous avez besoin du rôle **Warn** pour utiliser cette commande.") } let args = message.content.split(" ").slice(2); var member= message.mentions.members.first(); let reason = args.join(" ") message.member.send(`Vous avez été averti. Pour la raison suivante : **` + reason + `**. Dans le serveur : (**` + message.guild + `**).`) } });
use var member
because member is a user
let is better
yes
idc, im no javascript guy, but i know the syntax
member is = message.mentions.members.first();
i guess it returns the first member from the array
a user would be message.mentions.users.first()
^
a
i'm so idiot
wait
i test
no
this command send me
bot.on("message", message => {
if(message.content.startsWith(PREFIX + 'warn')) {
if (!message.member.roles.find("name", "Warn")) {
return message.channel.send("Vous avez besoin du rôle **Warn** pour utiliser cette commande.")
}
let args = message.content.split(" ").slice(2);
var member = message.mentions.users.first();
let reason = args.join(" ")
message.member.send(`Vous avez été averti. Pour la raison suivante : **` + reason + `**. Dans le serveur : (**` + message.guild + `**).`)
}
});```
🤦
look again in javascript message.member.send(`Vous avez été averti. Pour la raison suivante : **` + reason + `**. Dans le serveur : (**` + message.guild + `**).`)
member is still unused
ok
il change
no
cannot read property "send"
of undefened
if(message.content.startsWith(PREFIX + 'warn')) {
if (!message.member.roles.find("name", "Warn")) {
return message.channel.send("Vous avez besoin du rôle **Warn** pour utiliser cette commande.")
}
let args = message.content.split(" ").slice(2);
var membre = message.mentions.users.first();
let reason = args.join(" ")
message.membre.send(`Vous avez été averti. Pour la raison suivante : **` + reason + `**. Dans le serveur : (**` + message.guild + `**).`)
}
});
🤦
try changing it to: javascript member.send(`Vous avez été averti. Pour la raison suivante : **` + reason + `**. Dans le serveur : (**` + message.guild + `**).`)
yes i know, spoonfeed, idc anymore
message.member is the author of the message, and that is YOU
np
Does anyone know anything about making a xp system using node js and mysql?
Sqlite points system rewritten to xp
If you are sending the message to the author why not just do message.author.send()
Wait nvm i seen the code am on mobile so is kind of harder
Uhm this is probobarly really easy but how do I remove the command part like !say from the command itself? I just want it to say args[1] or more
Instead of eg command: !say hello everyone and the response being: !say hello everyone I want the response to just be hello everyone
I'm using discord.js
you can find the index of the first space and take the substring from there
that works too, but it's less efficient
efficiency is for the weak
ah you must be an enterprise dev
yeah x.substr(x.indexOf(" ") + 1) is only 20 times faster
small improvement at best
just started learning java.... I need some help with something
so, I made this function:
//Math.java
public class Math extends Main {
public int add(int[] numbers) {
int i = 0;
for (int num : numbers) {
i = i + numbers[num];
}
return i;
}
}
how do I then use it in my Main.java class?
Math math = new Math();
int result = math.add(<number array>);
even tho you most likely want to make that method static 🤷
Math math = new Math();
int result = math.add([1,2, 3, 4]);
that should work should it not?
er, java doesn't do array literals like that
but you can
int result = math.add(new int[] {1, 2, 3, 4});
you have to use that stupid syntax because arrays are typed
wait
also your summing algorithm doesn't quite work
think of the java for-each loop like a python for...in loop
so you would i += num instead of i += numbers[num]
the things you're iterating over are the elements themselves as opposed to the indices
extends Main 
yeah whatever
in Discord.NET how do i get the token to send the server amount
save it in a config
?
It's on the website
wait does it want the bot login token?
No
nononononono
ok good
Go to your bot's page on DBL, click edit
Scroll to bottom and click show token
That's the one you need for servercount
ok
can someone other than myself try setting up this bot? https://github.com/FabricLabs/doorman — not sure it is working, need a second pair of eyes
Uhm... I don't usually download bots
It's one of our devs, he rebuilt an old Slackbot we had for Discord
I'm not really a bot dev, so I figured someone else would know what to do with it
in Discord .NET how would i check if a message has a link in it
Regex, prob
what does discord count as a link
do links have to start with https
lets check
yes
hah i found a regex online
lol
xd
read the pins
I tried the pinned message but it didnt work 
@tawny lava My bot is just online now?
sorry for the peng
?
what lib
d.js
I think you need v12 for it to work



