#development
1 messages · Page 584 of 1
and the const tag is literally the tag already
I'm on mobile and not logged in and just notice theres a donate feature. Is that pretty easy to set up? also in terms of checking if someone donated
do I use user.username and stuff
@uneven wren donate bot
tag = username#discrim
oh
ok ill check out donate bot when i have a chance
yes it will send the user+disc already
vote.user
ok
something like .send(`${tag} (${vote.user})`)
do I put my code using the user+discr into the vote event?
yes since the scope of tag is there
You tried that edit so many times
idk why you cant escape single like things like that]
idk what they're actually called
oogf
I just created a mini server tbh for the votes for dbl api so that I can just send requests from my bot to that mini server
easier management
ok
@amber fractal something like this
Wouldnt you need to change your path in the dbl site?
Or does it listen to all of it or something
the path for sending the votes is just one
I mean
the path for receiving votes
the request for checking vote has 2 paths
oh shoot
uwu
is there to get t let voteEmbed = new Discord.RichEmbed()
.setTitle(${tag} just voted!)
.addField('ID', vote.user, true)
.setColor(Math.floor(Math.random() * 16777214) + 1)
bot.channels.get('552674443131093002').send({voteEmbed});
transfered
like bot doesnt wokr
maybe use webhook?
but i need to send
webhooks are easier on your use case
I'm just looking at your code and I'm confused some stuff, I'm not very good with listeners
So it listens on the port, so in the dbl site, the dblwebhook default path
where is that going in this case
Looking at this line fastify.listen(port, '0.0.0.0', () => console.log(`[Notice] Haruna's Vote Service is now Online, listening @ ${port}`))
to /vote/
yes thats the endpoint for dbl webhook to send to
so the path of your webhook on the dbl site would be /vote/?
@sinful lotus how do u use webhooks
yes just add /vote/
then that calls the onVote function when it gets a request
ALright
Just trying to learn something new
https://anidiots.guide/discord-webhooks @empty owl
ok thx
Your little lib thing is quite cool tbh
Uwu do I create a new app for webhooks
then checking for votes on my main bot is as simple as
class VoteManager {
constructor(client) {
this.client = client
this.auth = 'Lewd_Password'
}
async hasVoted(id) {
if (this.client.config.heroes.includes(id))
return true
const request = await this.client.fetch('http://coolstuff.net:69/hasVoted/', {
headers: { 'authorization': this.auth, 'user_id': id }
})
if (!request.ok)
throw new Error('Vote Service offline, please contact the developers')
return request.json()
}
async checkStatus(id) {
if (this.client.config.heroes.includes(id))
return true
const request = await this.client.fetch('http://coolstuff.net:69/getVotedTime/', {
headers: { 'authorization': this.auth, 'user_id': id }
})
if (!request.ok)
throw new Error('Vote Service offline, please contact the developers')
return request.json()
}
}
@amber fractal
@empty owl channel settings then here
ik
i got my link
like how do I make it send messages
without using bot
because I have to double login if I do that
require d.js on your server.js
then just refer to that code
So do these fastify.get('/hasVoted/', (req, res) => this._onCheck(req, res)) fastify.get('/getVotedTime/', (req, res) => this._onCheckInfo(req, res)) only run once?
But doesnt it listen on /vote/?
yes but that is post
basically
that server has 3 endpoints
POST /vote/
GET /hasVoted/
GET /getVotedTime/
thanks
it listens to all those 3 endpoints
it will get a request to hasVoted if you used that endpoint
Simple webhook vote handler for Discord Bot List https://discordbots.org/ - Deivu/Haruna
So you manually do it
that tackles
GET /hasVoted/
GET /getVotedTime/
To check for votes
Ill take a look
That's what I was wondering, if you called it yourself
I was just confused
Like I said not good with listeners and that
I just call the function on the listener
for example I call GET req in http://{hostname}:{port}/hasVoted/
then it will invoke
fastify.get('/hasVoted/', (req, res) => this._onCheck(req, res))
imagine it like
the hasvoted is the message listener, and the data is the req, res
I understand it now 
yes thats how simple my tiny bitsy wrapper is
I wish that someday I could do something like that 
I just did that so I dont have to deal with sharding limitations
I stopped logging votes a while ago
I just send money to their balance
It was getting to spammy
during night its usually spammy
but I just did that so I dont need to see in logs if it does its cronjob properly
but yeah thats how a basic api works as well so you can use it possibly in one of your creations in future
Idk about that exactly, but making requests to a server that I have running to run a function seems handy
yes it is really handy since you can slam it in another vps
and it wont affect your main bot process
possibilities are endless + fastify's overhead is really low
I was just reading some of fastify's docs
on a simple hello world api it can handle up to 78k req per sec vs the express which is 38k only
Would I ever even need 1K req/s tho lmao
not really but that overhead is nice to have
@jagged birch Yeah, if you could find a link that'd be nice; there's none
Lol look what you have me doing ```const fastify = require('fastify')()
const request = require('request')
fastify.get('/test/', (req, res) => doTheDo(req, res))
fastify.listen(666, () => console.log("ok."))
function doTheDo(req, res){
if(!req.headers.hi == "hi") res.send("No")
res.send("Sure bro, you're cool.")
}
const opts = {
headers: {
hi: "hi"
},
url: "http://localhost:666/test/"
}
request(opts, (err, resp, body) => {
if(err) console.error(err)
if(resp.statusCode == 200){
console.log(body)
}
})``` @sinful lotus 
Good thing tho
lmao
it worked
How would I send a different status code
is res.statusCode a thing?
ah res.code
yes on reject stuff I do that
Wait I did a dumb
Clearly too tired
I know how to do stuff

So my little prototype works
doesn't seem that hard to expand on
Does it?
Cool
(I definitely know what that means)
it that lie it auto closes on end?
or something
Welp since RR guy isn't here, anyone familiar with RE want to help me find a mem signature
Still in midst of scanning the PE bin
You should still be able to contact fishy if you're a patron

lol
uncaughtException: Unhandled error. ([object Object])Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object]) at Client.emit (events.js:169:17) at Client.emit (domain.js:422:20) at WebSocketConnection.onError (/home/marv/app/bundle/programs/server/npm/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:374:17) at WebSocket.onError (/home/marv/app/bundle/programs/server/npm/node_modules/ws/lib/event-target.js:128:16) at WebSocket.emit (events.js:180:13) at WebSocket.emit (domain.js:422:20) at _receiver.cleanup (/home/marv/app/bundle/programs/server/npm/node_modules/ws/lib/websocket.js:211:14) at Receiver.cleanup (/home/marv/app/bundle/programs/server/npm/node_modules/ws/lib/receiver.js:557:13) at WebSocket.finalize (/home/marv/app/bundle/programs/server/npm/node_modules/ws/lib/websocket.js:206:20) at TLSSocket.emit (events.js:180:13) at TLSSocket.emit (domain.js:422:20) at emitErrorNT (internal/streams/destroy.js:64:8) at process._tickCallback (internal/process/next_tick.js:178:19)
Got this error but no idea what could have caused it
client.on('error', console.error) listener is missing on your code
Thanks :3
That was the full error that got logged btw advaith
Didnt know what else to send
Hey
let playerID = message.author.id;
let playerName = args.join(" ");
if (!playerName) return bot.embed(message.channel, `Please provide me with a player name so I can create your profile!`);
var starterWeapon = await message.channel.awaitMessages(message2 => message2.author.id === playerID, {
maxMatches: 1,
time: 30000,
errors: ['time']
});
if (starterWeapon !== ["sword", "dagger", "hammer", "bow", "spear", "greatsword", "machete", "staff"]) {
bot.embed(message.channel, `That's not a valid starter weapon`);
} else { bot.embed(message.channel, `${message.author.username}, I see you choose ${starterWeapon}. Great option.`); }
bot.embed(message.channel, `✅ Created a new profile, with the name **${playerName}**, and the starting weapon **${starterWeapon}**.`);
var playerSecret = token.token(13, true);
db.set(`profileSecret_${message.author.id}`, playerSecret);
db.set(`profileStarterWeapon_${message.author.id}`, starterWeapon)
db.set(`profile_${message.author.id}`, playerName, message.author.username);```
any ideas why when i run the cmd it jumps straight to the created a new profile message?
i got it to work
Hello
why did you ping me
how do I require from a sub folder?
../data/xp.json doesn't work
.../
that doesn't work either
🤔
yeah
I tried
./../data/xp.json
nope
Hu
oof
../data/xp.json doesn't work ?
nope
../../data/xp.json
?
alright thanks
x
d
Noice
I am not be able to host my bot on keroku
Good, heroku is very shit. If you’re looking for a decent free host try glitch @pallid zinc
It can only support small bots though
Not if u use uptimerobot
If u set it up correctly it’s fine
Maybe
Ping the glitch server every 5mins with uptimerobot and it stays up 24/7. My bots been online for a year and I haven’t touched it since
i used to use glitch but my disk space would get full within a week
You can patch this
no free host is decent, dont be a cheapskater and use a free host
in my opinion, a vps would be better to host a bot on
yes
The bot stay 5 hours online and become offline```
I can confirm this
shouldn't have to ping it to stay up
free hosting wasnt designed to be connected to a websocket 24/7 and receive thousands of bytes a day, not only that but doing anything that is beyond sending a POST request e.g sending a message will probably crash
home hosting is better than free online hosting lel
yes
but one con is that your internet has to be pretty reliable
other than that using something like an rpi is much better
the comp its hosted on is plugged into the router. its been up for about a week now without going offline
if you use free hosting you are more than likely a shitty dev and you bot is more than likely shitty 🤷 change my mind
I am having a qna bot only
But making a new hq bot
Sorry to say I am Indian
My English is shit
So I love it
Where do I get a API Key of Fortnite? I've been looking, but not ending up on fortnite.com or epicgames.com
epicgames has no official fortnite api iirc
that are public that is
Should I try Fortnite Tracker API?
dunno never used any, but you will have to use third party ones
DigitalOcean, Scaleway, AWS, Google cloud
Thanks
Could someone help me out. I am playing around with eris and trying to make a bug report command that will send message from other servers to mine in a certain channel. IDK what I am doing wrong here
const bugchannel = client.channels.get('541729879864115200');
bugchannel.createMessage({```
i get an error saying get is undefined
python is a scripting language, but javascript feels more like a real language
they are both easiest
ok
"real language"
several people are typing
are there any bot for fixing english grammar ?
I'd say no, but on the other hand that makes me think why aren't there bots for that
or there might be one already made
lol
u understand that gramary took like years to make and then also u need to think how to embed the algorithm into discord lol
Clearly it doesn't work 
In d.js is there any way to go from ShardingManager to Shard so I can use the reconnect, disconnect and death events?
Or will I have to spawn shards differently
hey
async def poll(self, *, polldata: str): # !poll ASD
options = {"🇦": "Yes",
"🇧": "No",
"🇨": "I don't know.'"}
vote = discord.Embed(title="Poll", description="{}".format(polldata), color=discord.Colour.gold())
value = "\n".join("- {} {}".format(*item) for item in options.items())
vote.add_field(name="Vote now!", value=value, inline=True)
vote.set_footer(text="Time to vote: 10 Minutes left.")
message_1 = await client.say(embed=vote) # Send the vote embed in the channel. Use await self.bot.get_guild(snowflake).get_channel(snowflake).send(embed=vote)
await client.add_reaction(emoji=choice, message=message_1)
await asyncio.sleep(1200)
message_1 = await client.get_message(message_1.id)
counts = {react.emoji: react.count for react in message_1.reactions}
winner = max(options, key=counts.get)
await client.send("**%s** has won!" % (options[winner])) ```
what's the problem?
language python
lol
@cubic
fixed some errors and now this
is it still the same code as above?
not very much
wait i send it
async def poll(self, *, polldata):
options = {"🇦": "Yes",
"🇧": "No",
"🇨": "I don't know.'"}
vote = discord.Embed(title="Poll", description="{}".format(polldata), color=discord.Colour.gold())
value = "\n".join("- {} {}".format(*item) for item in options.items())
vote.add_field(name="Vote now!", value=value, inline=True)
vote.set_footer(text="Time to vote: 1 Minutes left.")
message_1 = await client.say(embed=vote)
await client.add_reaction(emoji=choice, message=message_1)
await asyncio.sleep(10)
await client.get_message(id=message_1.id, channel=self.message.channel)
counts = {react.emoji: react.count for react in message_1.reactions}
winner = max(options, key=counts.get) # < error there
await client.send("**%s** has won!" % (options[winner])) ```

I can't see any mistakes, plus I don't use discord.py async as it's a very outdated library
:/
Could someone help me out. I am playing around with eris and trying to make a bug report command that will send message from other servers to mine in a certain channel. IDK what I am doing wrong here
const bugchannel = client.channels.get('541729879864115200');
bugchannel.createMessage({```
i get an error saying get is undefined
await client.send("**%s** has won!" % (options[winner]))
Where are you sending
Why is your Context instance named self
to the channel where the command sent
Where did you specify that
its automatic send there if the location not specified.
After the timer runs out, it need to check te reactions on the message, then count the bigest reaction count,(where the error is happening) then it send the message.
btw sry for bad english.
@dusky steeple your code is very hard to read
await client.get_message(id=message_1.id, channel=self.message.channel)
You are getting message but not binding it to any variable
this is the code
async run(client, message, args) {
const bugreport = args.slice().join(" ");
if (!args[0]) {
return message.channel.createMessage(':x: Please supply a detailed report');
}
const bugchannel = client.channels.get('541729879864115200');
bugchannel.createMessage({
embed: {
color: client.config.options.embedColor,
author: {
text: message.author.tag,
icon_url: message.author.avatarURL
},
title: 'New Bug Report',
description: `${bugreport}`,
timestamp: new Date(),
footer: {
text: message.channel.guild.name,
icon_url: message.channel.guild.avatarURL
}
}
});
message.channel.createMessage(`:white_check_mark: Thank you ${message.author.username}, your bug report has been sent to Red Queen Support Server`);
}```
Not working.
So bascially, I use AWS (Amazon Web Services) and I was on the standard EC2 trial which gives you 1 vcpu and 1 GB of RAM, but I own a music bot and I have tested this on different locations in the west, east, central, etc.. and the east zones work well because the ping is better. However, when more than 3 servers use the music the CPU goes on 100% power, and the song quality is so bad, I would rather just leave. So then I switched to Microsoft Azure. Same thing east is better than central, and west, especially when I do my ping command. I am not sure also if I spam my ping command why it goes to a super high ping. I would like to find the error because I am not sure which area is the best and why my music bot quality is so bad.
Yes, streaming voice is resource intensive
So is there a way to reduce it because otherwise I have to pay, lol.
no
streaming music eats your resources
there is an ez fix tho
dont make a music bot

lol rip i already did
it depends on what you use for audio streaming
Like my language?
you can test different methods such as lavalink
Tim could to see what I am doing wrong. I posted my code above and what I am trying to do.
@junior summit the high ping isnt caused by any issue
its caused by your lib obeying discord ratelimits
lmao
@dusky steeple does eris even have client.channels? i cant find it in the docs
tbh idk. I am just guessing to get it to work lol
I will try that if not I will keep reading
wew
const config = require('./config.json'); is coming up with an unexpect token
i mean it doesn't like the / in ('./config.json');
i wonder how to fix it
@grim aspen try const config = require("./config.json");
Dk what you expected from changing apostrophes to quotes
lol
The error is probably elsewhere
any other info like, unexpected token X in line Z or something
That's happened to me a few times and it ended up being a either to many ; or not enough
someplace in the code
it says it's in JSON at position 4
Seems to be a problem with the JSON file itself

you mean this? const config = require("./config.json");
no
config.json
it's a problem with the json
not the require
or well send position 4 and around it 
figured it out
ALright
Json do be like that
json sounds like a punk
sounds like jason from friday 13th
How would you get info from a messageBulkDelete event, like the channel where the bulk delete occurred?
in discord.js it returns a collection of messages deleted
so you could get the channel from those messages
mk, I'll try that. thanks 👌
How do i embed files using imgur lol i tried to look it up but it wont work
Like upload files to imgur or fetch and put in embed
They have an api
You could fetch a random image link from their api gateway and throw it into your setImage
Can anyone help me with a customizable autorole command?
For example, >autorole set {role}
And what would it do
Because, right now, all I have is name-specific autorole
like give on join?
That's what autorole does
autorole???
What've you heard it called?
oh
Yes, it's a give on join, but I was using it in the general "autorole" command.
For like admins + to set
And @amber fractal I don't have a per guild setup yet
It's just specific to a role right now
You'd have to do that first unless you only want it to work for 1 server
well check if its enabled using a guild "database" then check for the role, then add the role by name
client.on('guildMemberAdd', async member => {
var role = member.guild.roles.find(r=>r.name == "user");
await member.addRole(role);
});```
bro r u not using modules
I dont export my events either
because am a cheep man
well what db do u do then
tarpergon who doesnt call it autorole
dude u can use modules on glitch
I've only heard it called join role
I know
But I am relatively new to developing bots and I have no clue how to
?
what db do u use
yes I can see what you're saying
ok
like which database do u use or do u not have one
well then u cant do per guild in an easy way
idk how to do autorole w/o databases
with a database u store a role, if the role exists, and it is enabled, it does it
I can make it with my database idk which one u like
o
anyone here good with OpenGraph tags
cause i cant get this site to work properly with them
can i post it here
This is the basic og stuff
then you have optional ones
Did you set a title/desc
i did title
what's the html?
yeah you have to wait until discord recrawls
wtf
why have i never known about this
pretty neat
What if I want to use another donate system(ex. Qiwi). Can I put a donate url in the long description of bot?

Args- array
I think you need args[0]
show what your args is. user object? user id string? array?
@crystal spear you can put anything in the long description but you can only change the link of the actual donate button if the bot is certified
anyone know how to format a date as: "Today at hours:seconds"? with datetime or time
embed object has a timestamp property that accepts datetime object
Post your server count
Who can help me with the guildmemberjoinevent? If so please pin me in the message or write to me privately
how to active a bot when it is offline ?
Run a bot inside a bot while that one runs another one
Why would posing server count with http return forbidden, the dbl token is for sure correct.

const { dblToken } = "token"
const DBL = require("dblapi.js");
const dbl = new DBL(dblToken, client);
dbl.postStats(client.guilds.size);

Thats not http
that's
Use this
already wrong
Js
Im not using the lib
thats very wrong
]]ev const { dblToken } = "token"
undefined
const { token } = "token" doesnt make any sense
]]ev const { dblToken } = "token"
dblToken
const { dblToken } = require("../../tokens.json");
const DBL = require("dblapi.js");
const dbl = new DBL(dblToken, client);
dbl.postStats(client.guilds.size);
undefined
the simplest is
const config = require('stuff.json')
config.token
The easiest way is providing a client when you make an instance of dblapi
something like const { token } is not really something the beginner instantly knows
Who uses semicolons
me
Bruh
how to make how much server my bot is in dbl 😅
That's what we were talking about

there are pinned examples in #topgg-api
Here is an easy code :
You give me something im not asking for
Ok thx
const DBL = require("dblapi.js");
const dbl = new DBL('tokenhere', client);
dbl.postStats(client.guilds.size);
i use python
Run this on eval
😅
i use js for music
what if they dont have dblapi.js
what will they do ?
Install it 
make your own
If I was going to use the lib, I'd have asked for how to do it with the lib, which is pointless because its as easy as passing your client 
for me I would just write it my own
man it doesn't matter
each to their own
if this isn't dev chat and more of just an argument
for me I just want it that way
Could I still get an answer tho
to the question I asked
I get unauthorizaed
but forbidden
not so sure
Are you manually requesting from the API or are you using the library
Yes, which is weird, as it works when I call my command to post stats
it's using nodes https
can you show the code you used
Sure give me a sec, in the middle of changing classes lol
do you put auth properly?

const guilds = await this.client.getValues.getAllGuildCount()
try {
await this.client.fetch(`https://discordbots.org/api/bots/${this.client.user.id}/stats`, {
method: 'POST',
body: JSON.stringify({ 'server_count': guilds, 'shard_count': this.client.shard.count }),
headers: { 'Content-Type': 'application/json', 'Authorization': qttoken }
})
counter++
} catch (error) {
this.client.cannons.fire(this.client, error)
}
@amber fractal is your headers the same like this?
I was cheating once
I was adding 10 servers 
try to regen your token maybe thats the problem
That's a class I'm working on, it works in it's own command, but it looks like this because it's specifically for me
If the token was wrong I'd get unauthorized, wouldnt I?
Maybe I'm passing something wrong
yes
Unless that's not correct
that's the postData
403 is forbidden right?
Ye
Weird
I'll figure it out later
const fetch = require('node-fetch');
const dblAPIToken = "";
const sendStats = async () => {
try {
const response = await fetch(`http://discordbots.org/api/bots/${client.id}/stats`,
{
method: "POST",
body: JSON.stringify({server_count: 420}),
headers: {'Content-Type': 'application/json', 'Authorization': dblAPIToken }
});
} catch(err) {
// handle error
}
};
try this
nod fetch is easier to manage in posting server count you can try that if you want @amber fractal
I know all that, it's just weird because it works in my standalone command
why does part of my css refuse to load?
index.html
<div class="modal" id="modal">
<h1>New grid</h1>
<br>
<div class="modal-content">
<div>
<input type="number" id="gridhorizontal" placeholder="Rows">
</div>
<div>
<input type="number" id="gridvertical" placeholder="Columns">
</div>
<div>
<a id="submit" onclick="generate()">Add</a>
</div>
</div>
</div>```
index.css
```css
.modal {
display: none;
position: absolute;
width: 60%;
height: 40%;
background-color: rgba(10, 10, 10, 0.9);
top: 1%;
left: 20%;
right: 20%;
color: white;
font-family: 'Montserrat', sans-serif
}
.modal-content {
display: flex;
justify-content: space-around
}
cache
try ctrl shift r
No
thanks ig lol
this problem happens every time i work on this project and its getting really annoying that i always forget the solution D:
I just use php to
Imma be honest tho
idk if its a good practice
LOL
this.client.id is undefined
no wonder it's forbidden
good job me
Maybe I should've logged the options earlier
lmao
What do ya know, it worked
does the discord.py client not have text channels array? I have to manually get them from every server?
When using discord.js I’m trying to detect when the bot stops speaking/playing a song.
This is the code I’m using rn:
data.dispatcher.on('end', function(){
console.log("Song ended!!!!!");
end(client, ops, this);
});```
According to the js docs (here https://discord.js.org/#/docs/main/stable/class/StreamDispatcher?scrollTo=e-end) the event “end” occurs when the bot ends the connection with the vc. So I would thus have to use the event “speaking”. So my question is, is there a semi simple way to detect only when the bot has stoped speaking?
Is there a reason it's returning undefined first and then the console.log(body) correctly? js
so it logs h as undefined then logs body as what it should be
Ping me if you have a response, still havent figured it out 
implementing unit testing after the fact is annoying
wym
i feel like if i program with testability in mind my code would be much better
111
Ow
well it's 1:50 for me so 
1250 here
central america or?
yep
show me
It was my issue from 3 hours ago
idk what that was
and your using d.js?
so .getuser is from your class?
what does get users internals look like
thats all of get user?
it's an htt call
http*
headers: {
Authorization: this.token
},
url: `https://discordbots.org/api/users/${id}`
}
request(opts, (err, resp, body) => {
if(err) return console.error(err)
if(resp.statusCode == 401) throw new Error("Unauthorized, invalid DBL token.")
if(resp.statusCode == 200){
console.log(body)
return new Promise((resolve, reject) => {
resolve(body)
})
}else{
return console.error("User not found.")
}
})```
I was bored
you return it from the callback to request
it won't return from the function calling request
relatable
Can anyone help me with the web hook that shows those that voted for the bot?
anyone know if it is possible to make servers counter presence dynamic without restarting the bot every time to get servers counter updated? sorry for the syntax, is bad i know EDIT: in python 3
update it on an interval
while client not closed:
do stuff
await asyncio sleep etc
thanks!
Alright
I was bored so I wanted to make my own lib thing or something 
It's too big gimme a sec
lol
And hastebin refuses to work
lol
www.paste.org - allows users to paste snippets of text, usually samples of source code, for public viewing.
That took way too long
wait
are you serious
it doesnt encode quotes 
i saw
It should actually be up now tho
but that should emit ready shouldnt it?
Can I not emit in the constructor?
I didnt think of that
Nah still didnt work
Well if you got any ideas, ping me please
Hey uh actual idiot here how do you make a prefix for a bot?
prefix = "!"
A little js mixed with more js
Assuming you're using js anyways
Yep
ok
why
You can make the https request yourself
how
I sent you exactly how I learned it
Hey u
I got questions for u
This is basically identical to yours but doesnt work
and my other thing I did
would you happen to know why it wouldnt?
what did you do?
it does say that it's listening
wym
it doesnt even run at all
which was the problem
did you init properly?
Yes, it did log the address and path
all as I expected it to
but when test the webhook
it doesnt work
So I have big confusion
also for some reason I cant emit anything even tho the class extends EventEmitter idk what it's problem is
console.log("vote")
if(req.headers.authorization !== this.auth){
res.status(401).send("Unauthorized")
}else{
res.status(200)
let vote = JSON.parse(req.body)
this.emit('vote', vote)
}
}``` This is the onVote part
and it isnt logging vote, so it isnt actually receiving anything
I was actually refrencing yours when making this part after it didnt work the first time
Should be running
It is a tiny bit different from what the dbl one says tho
it says *:5000
Wats are good bots that are like mee6 with a programing page
I know the mee6 website
Yeah
But what is the programming page
You mean with a dashboard?
Yeah
K thx
@sinful lotus Does mine even really differ from yours?
if the vote console.log isnt reached there could be a problem on how it listens
I wonder if I can manually call it
just use onVote() on init
Worked
but idk how else to set it up to listen
Well I got it to work, but when it tries to parse the body it fails
Wait holy shit
it's all working
And it emits vote
but not ready
odd
hey i have if (!message.channel.music) return message.reply(" You must be in a `music` channel to use this command."); in my code and even when im in the music channel , this still return.. any idea why?
how can i define the music channel?
because for my nsfw command i didnt have to define nsfw :/
Thats because its a setting in discord
Theres no such thing as a music channel option
im not sure how to define it
do you mean voice channel?
Might have caused this
I already made a bot named "Xbox" but when i want to invite it the page says UNKNOWN ERROR please fix this
ok
Postman has arrived. There was an error connecting to {} where {} is a link to a DBL endpoint. How come? 
Headers with auth and content-type specified and params are good
Oh, really
A new line kept fucking it up
maybe you need a new linter
What would be the most convenient way to store data of the bot? E.g. which prefix a server uses for the bot etc?
A json file sounds horrendous 😅
Database 
a database file will always be the best way to store data, prove me wrong
for beginners I recommend learning sqlite
mongo
Lol didn’t even think of using a database
I’ll check out SQLite and MongoDB, thanks guys :3
@le0
Is someone making bots with python?
around half of bots are written in python
i have a question and that's that whenever i try and use my bots report command no errors show up in the console so I'm confused here's the code.
You're not sending it anywhere and you have a return statement at the end of it all
ahhh thanks i fixed it now 👍
Lmao I smell TSC tutorials
why one of the bots can't find the server owner ? it's works in other servers but not here
gotta cache it yourself
or instead of all users, how about just cache the server owner
at least discord.py provides the owner_id property
is there some way of merging images into a new one and then send that image?
@primal socket JIMP if you're using node.js
okay, thank you for the help, i'm gonna check if that works
Can someone help me? I can not host my music bot on heroku ;-;
Don’t use heroku
Can you recommend another platform?
DigitalOcean, Scaleway, AWS, Google Cloud
thank you :^
There's a list in the pins here
return message.channel.send(`Please go to the Music channel to use this command.`);
}``` Command still runs even when not in the specific channel.
o oops
no
=== is correct
but you should learn about operator precedence
! has higher precedence than ===
so it's executed first
o
what you have is the same as if((!(message.channel.id)) === ('...'))
so you're basically doing if(false === '...')
yea i changed to !==
is there a way to add delay to a command? just curious
like a time limit on when everyone can use it again*
Like a cooldown on a command?
Yes, it's possible
cuz my bot doesnt add music to a queue , so when ever someone runs the command again it cuts off the current song and its so toxic
Or you could implement a queue feature
Because ur code was bad
i based it on a plexi tutorial so its probably out dated
if (args.options === 'nsfw') {
if (message.channel.nsfw === true) {
request.get('https://nekos.life/api/v2/img/nsfw_neko_gif').then(body => {
let embed = new Discord.RichEmbed()
.setImage(JSON.parse(body.text).url)
.setFooter(`Requested by ${message.author.username} | 💛 API : ${Date.now() - message.createdTimestamp} ms`)
.setColor(config.color.second);
message.channel.send({
embed: embed
});
});
} else {
let embed = new Discord.RichEmbed()
.setDescription(`\`â›”\` **${message.author.username} :** \`#${message.channel.name}\` must have \`NSFW\` enabled.`)```
i can use my command in non nsfw channels
and idk why
can someone help me?
if(!message.channel.nsfw) return; :>
Iirc nekos.life endpoints shouldnt be used
they return loli
Yes
still can use it in non-nsfw channels
Here, I think this will work, but I didnt test it.
if (!message.channel.nsfw) {
let embed = new Discord.RichEmbed()
.setDescription(`\`â›”\` **${message.author.username} :** \`#${message.channel.name}\` must have \`NSFW\` enabled.`)
} else {
request.get('https://nekos.life/api/v2/img/nsfw_neko_gif').then(body => {
let embed = new Discord.RichEmbed()
.setImage(JSON.parse(body.text).url)
.setFooter(`Requested by ${message.author.username} | 💛 API : ${Date.now() - message.createdTimestamp} ms`)
.setColor("#ffffff");
message.channel.send({
embed: embed
});
});
}
ok
if (message.channel.nsfw === true) { why bother doing that, message.channel.nsfw is a bool itself
Yes, just so you can learn/know, if (!message.channel.nsfw) { is checking if the channel the message is sent in is not NSFW, ! in Javascript basically means: "is not" so the code means "if channel is not NSFW then".
shit
i forgot some part of the code
class NekoCommand extends Command {
constructor() {
super('neko', {
aliases: ['neko'],
channelRestriction: 'guild',
args: [{
id: 'options',
type: ['nsfw']
}]
});
}
exec(message, args) {
if (!args.options) {
request.get('https://nekos.life/api/v2/img/neko').then(body => {
let embed = new Discord.RichEmbed()
.setImage(JSON.parse(body.text).url)
.setFooter(`Requested by ${message.author.username} | 💛 API : ${Date.now() - message.createdTimestamp} ms`)
.setColor(config.color.second);
message.channel.send({
embed: embed
});
});
}
if (args.options === 'nsfw') {
if (message.channel.nsfw === true) {
request.get('https://nekos.life/api/v2/img/nsfw_neko_gif').then(body => {
let embed = new Discord.RichEmbed()
.setImage(JSON.parse(body.text).url)
.setFooter(`Requested by ${message.author.username} | 💛 API : ${Date.now() - message.createdTimestamp} ms`)
.setColor(config.color.second);
message.channel.send({
embed: embed
});
});
} else {
let embed = new Discord.RichEmbed()
.setDescription(`\`â›”\` **${message.author.username} :** \`#${message.channel.name}\` must have \`NSFW\` enabled.`)
.setFooter(`Requested by ${message.author.username} | 💛 API : ${Date.now() - message.createdTimestamp} ms`)
.setColor(config.color.err);
message.channel.send({
embed: embed
});
}
}
}
}```
https://hastebin.com/usavecutuj.js can someone tell me why when i run the command again , the song doesnt add to the queue it just turns off the current song and plays the one that was previously added.
hm. was there a problem with the code i gave you? eyotsh
no errors
Cause like i said that's how i do it and it seems to work but idk if it works always
but still workin' in non nsfw
but i forgot 1 part of the code
look at the beginning
wowowow
another thing i forgot wait
now
So at the beginning add an nsfw check to (!args.options), like if (!message.channel.nsfw) or similar, like you did in the nsfw args section. Then it should work.
ok
uhh
sorry for asking, but how xD
i never used checks before
only for role permissions
you did use a check though.. if (message.channel.nsfw === true) { is a check :P
Ok hold on
ok
if (!args.options) {
if(!message.channel.nsfw) {
//Error: Failed NSFW check, command wasnt run in NSFW channel!
} else {
//Command passed NSFW check, was ran in NSFW channel, so execute the command here.
}
}
It should look something like this ^^^
https://hastebin.com/usavecutuj.js can someone tell me why when i run the command again , the song doesnt add to the queue it just turns off the current song and plays the one that was previously added.
i am not sure what you mean, so the song doesn't add anything to the queue it just skips to the next one when someone adds a new one?
and you are welcome!
playStream(bot, bot, fetched);
discord.js and discord.py
idk java
also <a class="button is-link" onclick="href='mybotoauth'">ADD USAGIX TO SERVER</a> doesnt seem to work
oof
I think theres only two right? Discord4J and JDA? So just try them both out and see which one is best for you
@empty owl
no
oh ok
Im guessing that mybotoauth is the link
nooo
oh shoot
you mixed up the class and href
look for it in dev tools
ok
Having a weird error, it keeps saying that theres an unexpected token in the JSON I'm trying to parse when there isnt
most likely a missing , or }
I was parsing when I meant to stringify
EIther way, I didnt need it anyways
I don't know why my webhook refuses to send this embed
what is a promise pending
A pending promise
thx
Alright, but is there any reson my webhook doesnt send this
It shouldnt be empty
reason*
im horrible at webhooks
{embed: X} -> {embeds: [X]}
When did they change it?
I send my other ones with just a variable tho
then it wraps in an array internally
hey whats the problem?
javascript language.
```if(cmd === ${prefix}poll) {
let szavazás = args.join(" ").slice(22);
if (!szavazás) return message.channel.send("Give a title!"); //this is not working
let szavazásEmbed = new Discord.RichEmbed()
.addField(`${szavazás}`);
message.channel.send(szavazásEmbed);
}```
why slice 22
also @inner jewel would it become {embeds: [embed: {//embed stuff}]}? or just {embeds: [//embed stuff]}
do you know how arrays works
Don't u need something before the []
I didn't send that
I was just wondering of the syntax
Because it sent an empty message
Got it to work
Help - our bot just crashed with UnhandledPromiseRejectionWarning: Error: This session would have handled too many guilds - Sharding is required. and when trying to restart we get the same issue... we are installed in about 2,500 servers...





