#development
1 messages · Page 1098 of 1
nice
My bot is so niche
Same
I can’t see it getting much love
what is it
It’s a ‘go’ bot
a whatnow
I can see mine people be curious about, but not use for long
Go being the board game from ancient china
pretty cool if it works
Hey, I do not know if that belongs here but I have a problem. So running "!pause" will pause the song and output that.
Running the command again will resume the song but "Song paused" is given out. Can someone give me a tip how to output "Song resumed" then? :)
async def pause(self, ctx):
client = ctx.guild.voice_client
if client.is_paused():
client.resume()
await ctx.send("**Playing song.**")
else:
client.pause()
await ctx.send("**Song paused.**")
is this what you mean?
@whole knot
how come some bots have a max purge limit of 1000 but it says I'm not allowed to go above 100
limit: int value should be less than or equal to 100.```
@halcyon crow
Lol
Gonna stop posting screenshots though b/c don't want to advert
Nah that was anti advert
;P
No way im getting it now
I trained it with a detox_wiki_40k_lines.tsv
Lol
It's hosted by Microsoft, and it's full super super offensive training data
But it's because it's unfiltered
@restive willow Yes, but the problem is that I worked with Client, which is needed as my bot also listens to reactions. I hope you understand the problem there as I also tried your method
@whole knot Is there no way to set an event handler for that?
@bright dove the limit is 100 for everyone
what they do is execute it multiple times until the requested amount is reached
@restive willow Yes, but the problem is that I worked with Client, which is needed as my bot also listens to reactions. I hope you understand the problem there as I also tried your method
@whole knot im not sure what you mean but that shouldnt mean you need to work withClient. look atwait_forandon_reaction_add
what they do is execute it multiple times until the requested amount is reached
@quartz kindle oh... is adding that a lot more complicated than a normal one? or is that easy to do
its just a loop
a loop and some math
@restive willow I will have a look at that, guess I should rest a bit and I will get there myself. Thanks though! ❤️
Hey thankyou for telling me abt botghost
i have one last question
is there anyways with botghost i can make a command that lists the ammount of members in my server
jda
guys
i just hit a milestone
22 server
*servers
i am so happy its not even funny
Hi, this question is not related to a bot: How can I get a user avatar to display it on a website? so whenever he change it it will change at the website aswell
A user logged into the website?
https://discord.com/developers/docs/resources/user#user-object
if the user is logged in, you will get a user object, with the avatar hash
woa
Recruiting devs for a bot named "Skynet". It will have more features than MEE6 and Carl bot. To audition/join Dm me
Better be paying pretty good to have more features than mee6 and Carl bot
Hello! I am trying to create a rank order thing, but the prefixes arent lining up, can anyone help?
let level = u.level;
let j = 0;
let xpInLevels = 0;
if (level >= 1) {
do {
let multiplier = j * 1.25;
if (multiplier === 0) multiplier = 1;
let xp = 150 * multiplier;
xpInLevels = parseInt(xpInLevels) + parseInt(xp);
j++;
} while (j + 1 <= level);
}
let ranks;
switch (++j) {
case 1:
ranks = "🥇";
break;
case 2:
ranks = "🥈";
break;
case 3:
ranks = "🥉";
break;
default:
ranks = `#${j}`;
}
let xp = parseInt(xpInLevels) + parseInt(u.xp);
let text = `**${ranks} ** **${m}**```
🤔
Any node experts here?
Xdd
@commands.command(pass_context = True, aliases=["c"])
@commands.cooldown(1, 5, commands.BucketType.guild)
async def math(self, ctx, num1, num2):```
How do I make the error for @commands.cooldown
it works but Idk how to display error
how
Do you have an on_command_error?
nah
how to check if the member is connected to the same voice channel as the bot?
in discord js
@pale vessel ok man thanks
what is the tag to detect a role mentioned by a user?
For example : for users its message.mentions.channels.first()
For roles it will be what?
Hey can anyone give me some info on formatting some JSON
I have some nested values here
I'd like to assign a value to the "save" key and also the "server" key
I know i'm still working on everything
So what i'd like to do is after parsing it
I'd like to access json.save
and have one string
and another for json.save.server
Well yes
But I'd also like to have a string value return from the parent key
yeah
in your example "9"
UH
So what I want is
I want to be able to have the key "save" and have a string value assigned to t
And also have sub keys of "save" with their own string values
i wonder if i can just do "":
So i have a method that takes a good while to run but isn't always necessary to have my bot running, is there a way to start the method and continue normal message listening/bot function and let it continue when its done?
its one that i created
it takes several minutes to run
yeah thats what ive been looking into
theres stuff to do threading with python yes?
should i use the threading library?
is a web dashboard worth it ?
i feel like my bot got declined because it wasnt active for the logest of time, but its online now and i dont know if it got declined while it was offline
guys is my addField correct?
.addField("usage","${command.config.usage || "No Usage"}")
template strings are done with `
does anyone here use mongoose and think they can help me
message.member.roles.add()
this is the line for adding roles
what if i wanted to assign the role to a member defined by a variable?
this is what i thought would work
roleuser.roles.add()
^
TypeError: NovelCovid is not a constructor
at Object.<anonymous> (/app/commands/info/corona.js:3:15)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
at /app/handlers/command.js:19:24
at Array.forEach (<anonymous>)
at module.exports (/app/handlers/command.js:11:32)```
what should i do?
what is NovelCovid
package
imagine needing an extra package when you can use the api directly
oops i'm sorry because that can be taken as toxic
const { NovelCovid } = require("novelcovid");
const track = new NovelCovid();
module.exports = {
name: "corona",
category: "info",
description: "Get the stats of corona",
usage: "corona all or corona <country>",
aliases: ["covid", "covid19"],
run: async (client, message, args) => {
if(!args.length) {
return message.channel.send("Please give the name of country")
}
if(args.join(" ") === "all") {
let corona = await track.all() //it will give global cases
let embed = new discord.MessageEmbed()
.setTitle("Global Cases")
.setColor("#ff2050")
.setDescription("Sometimes cases number may differ from small amount.")
.addField("Total Cases", corona.cases, true)
.addField("Total Deaths", corona.deaths, true)
.addField("Total Recovered", corona.recovered, true)
.addField("Today's Cases", corona.todayCases, true)
.addField("Today's Deaths", corona.todayDeaths, true)
.addField("Active Cases", corona.active, true);
return message.channel.send(embed)
} else {
let corona = await track.countries(args.join(" ")) //change it to countries
let embed = new discord.MessageEmbed()
.setTitle(`${corona.country}`)
.setColor("#ff2050")
.setDescription("Sometimes cases number may differ from small amount.")
.addField("Total Cases", corona.cases, true)
.addField("Total Deaths", corona.deaths, true)
.addField("Total Recovered", corona.recovered, true)
.addField("Today's Cases", corona.todayCases, true)
.addField("Today's Deaths", corona.todayDeaths, true)
.addField("Active Cases", corona.active, true);
return message.channel.send(embed)
}
}}```
this is my code
but it was working
before i added canvas senpie
canvas senpie?
thats a package too
Hi
where can i promote my bot
go apply on the website
@weak rain lol
Canvas senpie
@weak rain as I said, it's not a constructor, remove that line and call everything directly on the object that you're importing
go apply on the website
@weak rain ty sir
@low shard my friend advised me that
@weak rain as I said, it's not a constructor, remove that line and call everything directly on the object that you're importing
@copper cradle which line
if(args.join(" ") === "all") {
let corona = await track.all() //it will give global cases
```
go to their page and read the examples they have
ok
and on the second line remove those {}
lol
at Module._compile (internal/modules/cjs/loader.js:703:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
at /app/handlers/command.js:19:24
at Array.forEach (<anonymous>)
at module.exports (/app/handlers/command.js:11:32)
at /app/server.js:19:35```
now here
@copper cradle
server.js?
ok
const { config } = require("dotenv");
const discord = require("discord.js") //Gonna use Discord.js Module xD
const Canvas = require("canvas");
const client = new discord.Client({
disableEveryone: true // what does this disable thing do?
});
const { CanvasSenpai } = require("canvas-senpai")
const canva = new CanvasSenpai();
const db = require("quick.db") //WE WILL BE USING QUICK.DB
const { addexp } = require("./handlers/xp.js")
client.commands = new discord.Collection();
client.aliases = new discord.Collection();
["command"].forEach(handler => {
require(`./handlers/${handler}`)(client)
})
client.on("ready", () => { //When bot is ready
console.log("I am Ready to Go")
client.user.setActivity(db.get(`status`)) //It will set status :)
})
client.on("message", async message => {
if(message.author.bot) return;
if(!message.guild) return;
let prefix = db.get(`prefix_${message.guild.id}`)
if(prefix === null) prefix = default_prefix;
if(!message.content.startsWith(prefix)) return;
if (!message.member) message.member = await message.guild.fetchMember(message);
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const cmd = args.shift().toLowerCase();```
if (cmd.length === 0) return;
// Get the command
let command = client.commands.get(cmd);
// If none is found, try to find it by alias
if (!command) command = client.commands.get(client.aliases.get(cmd));
// If a command is finally found, run the command
if (command)
command.run(client, message, args);
return addexp(message)
}) //All codes link in description
//GONNA USE EVENT HERE
client.on("guildMemberAdd", async (member) => {
let chx = db.get(`welchannel_${member.guild.id}`);
//Better :)
if(!chx) return;
//Canvas code
let data = await canva.welcome(member, { link: "https://cdn.discordapp.com/attachments/706050979941843033/737985899442208789/20single-frame.png" })
let wembed = new discord.MessageEmbed()
.attachFiles([{
attachment: data,
name: "hello.png"
}])
.setColor("RANDOM")
.setImage("attachment://hello.png")
.setThumbnail(member.user.avatarURL())
.setDescription(`** Welcome <@${member.user.id}> To our Server**
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
**Make sure to**
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
**Read and Follow our Rules.**
**Be upto date with our announcements.**
**Make new friends in the chat and be active.**
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
**We hope that u have fun in the server!**`);
client.channels.cache.get(chx).send(wembed)
})
client.login(token)```
@copper cradle
:/
well
thunder are you still having the same problem?
na its another
ah ok
can u help me related this?
anyone?
Nope, sorry
how do i check if a member has the role specified
which lib?
hi
embed.attachFiles([attachment]);
embed.setTitle(data.title);
embed.setImage("attachment://image.png");
``` I create a image with canvas and chart.js but the image doesnt get send. I validated that a image is generated (sending the image in a channel works) also validated that the embed is valid and accepts images (used a url for a temporary image)
v11 or v12?
const attachment = new Discord.MessageAttachment(canvas.toBuffer(), 'image.png');
embed.attachFile(attachment)
embed.setImage("attachment://image.png");
@lusty quest try it
V12
this is also what i already do
const canvasRenderService = new CanvasRenderService(width, height, (ChartJS) => {});
const image = await canvasRenderService.renderToBuffer(configuration);
const attachment = new Discord.MessageAttachment(image, "image.png");
let embed = new Discord.MessageEmbed();
and message.channel.send(attachment) sends in the Image
make one empty field but then it will probably look wired
PythoDocs can help you
how do i check if a member does not have the role mentioned?
bro can help me, i have some error when install npm quick.db pls help 🙂
msg.member.hasRole
I believe
@earnest phoenix
Install: XCode
Run: npm i -g node-gyp in terminal
Run: node-gyp --python /path/to/python2.7 (skip this step if you didn't install python 3.x)
Run: npm i quick.db
How do I do empty field in python
Read doc
o okay thx
@mild flower roles.has
How do I do empty field in python
@earnest phoenix u cant ig
let promise = Promise.all(a);
(await promise).forEach(p => { if (p) console.log; else return })```
so i tried this and it logged nothing
My English is bad
@pure lion what did you pass to it?
All the guild IDs from oauth, so there are some null and some not
Before it logged everything including nulls
not sure if this is still needed but try console.log(p)
bruh
@lusty quest I did that, it's an array of resolved promises
@earnest phoenix send me that code pls
thats just 101hax
Search it yourself
lmfao
I just want to filter out the nulls
Programmer need searching skill :)
@earnest phoenix just give the code pls
Nuh no spoonfeeding code
xd
but u can actually add \n\n in the description itself
like i did
embed.add_field(name=title, value=description + "\n\u200b")
ty
Nfp
but title wot remain title
.-.
wont*
@pure lion you get an array in a array?
usually for each should make a new Console.log for each entry in the array
em.add_field(name=title, value=description + "\n\u200b")
when I do this
it says title isn't defined
lmfao
add some text into title
I don't want
also into description
there to be a title
Do anybody has 10 coins of member + bot
I want it completely empty..
hence empty field
u cant to it
I don't want
3 of these
in row
I want 2
put
maybe invis text
inline=False
that won't work
how do u want it to be
dm me
Mongodb gud or nah
I’ve used it long enough to say its okay
i use json files .-.
e w
U serious?
@slow fable you need a DB NOW
yep
@slow fable use quick.db
lmao is it free tho?
@slow fable get a db or ill spam your dm
512MB free
I wanna filter nulls from an array, how I do?
maybe like for loop or sm
array.filter(p => p<1) something like this
Well its an array of both nulls and maps, would that still work?
array.filter(m => m!=null||m!=undefined)
^
Ok thanks
np
Its only null btw so it's fineeee
>>> let a = [1,2,3,4,5,6,null,"a", null, "e"]
undefined
>>> a
Array(10) [ 1, 2, 3, 4, 5, 6, null, "a", null, "e" ]
>>> a.filter(elem => elem != null)
Array(8) [ 1, 2, 3, 4, 5, 6, "a", "e" ]
sHivaCo
i still hate canvas. like the issue i have make no sense for me
Freeshivaco
Paidshivaco
Hey, can anyone tell how to time the bot to run specific commands
like cleaning a channel daily at specific time
#shit
I give up
@earnest phoenix ok
You can search google for the codeee
Just use setInterval(function (params) { //cool shit }, timeout)
@pure lion ok thanks
If the bot restart
U fucced
The interval will got reset
ooh okay
I cant think of a way to do it
Excdept
Set an interval that run every 1 second that check time
will search for it
Wdym by that?
So
You can do something like
Get roles map
And filter them
.filter(r = r.name).includes("somerolename");
and if the role doesnt exist, it will return falsr
let rmentioned = message.mentions.roles.first() || args[1] if(!rmentioned) return message.channel.send(Erole)
if i do this it wont detect non-role words
oh
any way to modify this if statemtn?
i want it to include non-roles
so you want the statement to detect non role?
if(rrmentioned = !message.roles) return message.channel.send(Erole)
wont something like this work
so you want the statement to detect non role?
yes
hmm
return;
$ma
Hello there,
In my bot I am trying to make a mute system which the mutes are stored in a dB and when the bot restarts it loads up this dB. What is the best way for me to go about loading them back up? Would I use timeouts or do something more efficient (I am using node.js and Eris). Thanks!
so you want the bot to poad the db everytime it restart?
Fucking share button always sending the wrong channel
@golden condor sorry for ping
so you want the bot to load the db everytime it restart?
@earnest phoenix yes that's what I want, I can do that but I want to try and make it so it loads the mutes efficiently
When will my bot show on the website?
@vestal walrus when it get verified
Is that easy?
Ok thanks
does the inline thing in python work properly?
Hello there,
In my bot I am trying to make a mute system which the mutes are stored in a dB and when the bot restarts it loads up this dB. What is the best way for me to go about loading them back up? Would I use timeouts or do something more efficient (I am using node.js and Eris). Thanks! I have sorted out loading the mutes with the database, all I need to do is wait out the time (I have calculated it) and I am not sure how to go about that, whether I should use timeouts or I should use another method to make it more efficient. Another thing, if I used timeouts, how would it work correctly, as it might not work due to it waiting for the timeout to finish.
@earnest phoenix what
run a loop which checks the time when the person needs to be unmuted, if the time matches current time then unmute
maybe
just an idea
i'ld say use a setInterval that checks the dB each minute
the setInterval can check the entire dB with a foreach
oh ye
and seconds who cares
I got him
why would someone be muted for 3 seconds
in this case make it check every 30 sec
mutes.map(m => {
if(m.time <= Date.now() ) {
//Unmute
}
else {
setTimeout(() => {
//Unmute
}, mute.time - Date.now())
}
return;
})```i feel as though something like this would work
But checking every so often is a good idea too
no
the entire function needs to be in a setInterval
that runs every, let's say, 30 secs
No this is on startup
yes ik
The thing I put about
but it's better to me to use a setInterval
i made a bot
so you don't have to handle startup
i am so fucking proud of it
I'm just considering the efficiency
I mean
So how often should it run
I am just thinking how to go about it
I think your idea works
But for like accurate things I could do like every 5s?
how to restrict bot from rplying to admins on keywords ?
I tried
If message.author.roles != 'Admin' :
But it didn't work
Python I assume?
But for like accurate things I could do like every 5s?
@golden condor I think 5 seconds would be a bit too migh, try 10
So what about shorter mutes, what should I do for those, use that system or have a seperate one (that's why I was thinking 5s)
how to restrict bot from rplying to admins on keywords ?
I tried
If message.author.roles != 'Admin' :But it didn't work
oh
is the role name admin?
@glass steeple
or you can check the perms directly
Because people are stupid
true
So I am thinking to do every 5s for more accuracy
every 1s is more accurate
Yeah but a bit unnecessary
load the data into a file
5s is ok
I am thinking of storing them in a seperate collection
What's wrong with that
also doesnt it slow up?
ye
but not too loch to make the bot laggy
what about 30 sec muted
erm
what about 30 sec muted
@tight plinth settimeout
you should change it every 13 sec
@earnest phoenix i copied the role name , but it didn't worked , people roles gives a list of roles so u have to check in the list for admin , so will tey that
so its not ratelimited
Should I store them inside the map
ye ur code is wrong @glass steeple
inside the db
ur code doesnt check the name of role
@earnest phoenix hmm, i will check in the list of roles like , Admin in member.author.roles
if i.name.title()= 'Admin':```
role is an object
it has different attributes
admin is a string , so u cant compare it with role object
@tight plinth will do this every 30 seconds and for mutes less than 30s I will use a timeout
good idea
My idea-
Or I could do it for less than 15s
@tight plinth will do this every 30 seconds and for mutes less than 30s I will use a timeout
@golden condor is it a private bot
or a public one
lol i change it every 5 minutes on my bot. to fast is in my opinion annoying
or maybe load all the data into a json file
and further mutes get added to the json file as well as the db
@golden condor is it a private bot
@earnest phoenix public
I have an idea, not sure how good this is. You can set a Timeout for every mute
On start up
then maybe u can make some moni with it if it becomes famous xD
put cooldown for the non premium users
and no cooldown for prem
xD
101 business xD
@tight plinth what do you think of setting a timeout for every mute?
Good idea
i'ld say it doesn't matter but every minute seems better to me
or just add a restriction that mute time cant be less than 1minute
I'm just wondering how efficient that would be
you might exhaust the pool by setting a timeout for every action
So the interval is better?
im not entirely sure how well node handles it so i can't exactly suggest what's the best
looking back at my old code in c# i had something equivalent of setTimeout for every action, but that's because c# is multithreaded
Oh ok
how to make api loop with fetch ?
Ok
loop?
i mean autoupdate
What is the context?
what do u mean ?
I mean what are you trying to do? What needs to be auto updated?
**${json.data.dynamicKeys[6].pakFilename}:**
\`\`${json.data.dynamicKeys[6].key}\`\``
this
u wanna the full code ?
it's an api
what can I do against YouTube rate limiting lavalink node?
Does lavalink get directly from YT?
lavalink scraps
what can I do against YouTube rate limiting lavalink node?
ip rotating
e
How noticeable is the difference in speed between discordpy bots and nodejs bots? Or are other factors more limiting?
node is singlethreaded so there's that
multithreaded languages will always be more performant than single threaded ones
Python doesn't have true multithreading though right?
How?
you have to install python 2.7 and windows build tools
ok
Woops
hmm is quick.db lag ?
Nah
<p id="uGuilds">
<script>
let s = document.getElementById('uGuilds')
`<%-userGuilds%>`.forEach(g => s)
</script>
</p>
userGuilds is an array of maps and i want to create a grid for each guild that holds params of each map in individual lines columns (haha very funny i know im putting nosql into sql)
can anyone help me with some discord.py
Why not just post the problem and see if anyone can help that way lol
@still lily don't ask to ask
how can i save a attchemnt that was send by a user in discord.py
for attachment in message.attachments:
make a GET request to the attachment url and save what's returned in the response body
attachment.save
^
rtfd
await save(attachment) <--- wrong, my mistake
... no?
oh that exists
literally what I just did
shivaco is right, my mistake
Do you mean a table by grid or literal grid?
how do you expect the code to know what attachment is
i forgot how to spell anyway
You're not getting the attachments in the message
Do you mean a table by grid or literal grid?
table ye
Nothing is happening...?
Just wait
just wait ™️
Just wait™®©
if anyone could just give me the code for the command would be epic its 1:30 am here and my brain isnt really working
no :)
im just gonna do something else in the mean time
enter
press enter
go to sleep and then pick it up in the morning
lmeo im press and it done lmeo
message.attachments
which is a list of Attachment object
And those objects have a save method
a
so how would that look in a full command @slender thistle
<p id="uGuilds">
<script>
let s = document.getElementById('uGuilds')
`<%-userGuilds%>`.forEach(g => s)
</script>
</p>
userGuilds is an array of maps and i want to create a table that holds all of the shit in each map (every param has its own cell)
so how would that look in a full command
pretty damn cool
Iterate over message.attachment, the current element named attachment (for attachment in message.attachments:)
then inside that loop, you use attachment.save
k ill try that
for (const every of array) { /*do stuff*/ }
oh heyyy my net went down again
jejejejeje
I mean there's an option of making a row with column names and then putting actual data in rows below
That would be useful but can it be made over iterations
?
Fuck it just send me da docc
It can, just make a table element, append all your shit to a string, and then edit the table's innerHTML to table contents (the string you edited)
command to mention channel ?
its string
^^
Still same oof
you're trying to make the argument a for loop
I wish everyone Good luck With You're bots
Sry for My Wirting im Trining to type Englisch on a german keyboard
typing in localhost:5000 too much today fucking help
Hello guys, I am trying to code my bot and I keep getting this error for no reason at all as soon as I start to connect
Error: Client network socket disconnected before secure TLS connection was established
ohno
Ok nvm it was lavalink being bad
<table id="uGuilds">
<tr>
<th>Guilds</th>
</tr>
<tr>
<td><%-userGuilds.map(g => g.guildID).join('\n')%></td>
</tr>
</table>
how do i create a new table element for each guild?
g => `<tr>...</tr>`
client.guilds.cache.map(r => r.name)
That sounds like a CSS issue
default html tables are not styled
nah
TIL
example
It doesn't make a new row for every ID
imagine using html tables and not css grids
What's the difference actually
@slender thistle css grids are nicer imo
less having to pussy foot and remove the outlines of table shit
flexbox grids >>>>
Someone confused rows with columns apparently
yes
u h
Guys how to add emoji in .setFooter
you can't
bruh.
@restive furnace cant use custom one?
@torn ravine used custom one
HEy guys i wanna 1 more
i want my info to be this
Cat Police
This is a quite easy to use which contains : '' Moderate | Information | Fun | Animal | Social & more systems. "
Invite Discord Prefix
Click Here Click Here .
Team
@compact flume
are you familiar with inline
inline: true right
or you can just addfield(””, ””, true)
Ya
so what ur problem
i use inline: true in my bot
@robust arrow can you come to my bot test real quick?'
hey guys
i saw this tutorial on how to host bot 24/7 and i have to add my github repo to heroku
and i have to deploy branch in one step and it recognized a mistake in my package,json
it said this
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- node_modules checked into source control
https://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits
i dont understand
can someone explain
dont use heroku to host discord bots
then what should i use
oh
Use heroku
get a vps
^
is the bot dev badge forever?
@obsidian shell no
Use heroku
@obsidian shell how
@earnest phoenix except if you delete your bot, it wont go away
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploysSome possible problems: - node_modules checked into source control https://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits
@obsidian shell i need u to explain this then
pls
i need help
do not use free host
Oc
I have a video that explains it well, but it is in Spanish
Oc
ill try to figure out
Is there a way to add/replace values in a map?
Hey
Issue?
Webhools
Use the DBL API
or anything I want
Webhooks
it does, you just did it wrong
Take the vote and do what you want
I don't want it in a command
Ffs
I want it like an event
Use the api
DBL webhooks != discord webhooks
oh
I saw this example
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
so when someone vote, this will get triggered?
Yes
op
Ok
I will try it
and here
const dbl = new DBL(yourDBLTokenHere, { webhookAuth: 'password', webhookServer: server });
webhookServer isn't required?
so if u are able to log it in a console u can even make it so it sends a message in a certain channel?
is there any tutorial for the webhook servers?
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
``` this
Yes, the server just receives the vote
And you console log the ip
Id
Then you can do anything in JavaScript else
How do I set a background image for my site so that it always fills the screen?
No tiling btw*
sounds like background-repeat
can i use discord webhooks?
so i will still need the server
background-repeat: no-repeat;
Yes
something like this maybe @pure lion
can u send an example of the server?
You just sent one
Yeah but i want it to fill the screen too
so that's it?
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' }); like where do i find the pass? or just the webhook token?
Dbl token is in the api docs
The auth you can set in your bots edit page
oh okay
you can do better than this
No I can't flaz I searched that last time and I'm a retar x)
what is the advantage of this
console.log(`Webhook running with path ${hook.path}`);
what?
thanks
I think I crashed discord.com
wait
It's a joke
everything is working fine
I didn't crash discord.com
It takes time
ok
i got how to host a bot 24/7 i think
i did it with heroku and github
Ew
let promise = Promise.all(a);
let mDBguilds = (await promise).filter(x => x != null)
for (let guild of mDBguilds) {
guild.set(guildID, client.guilds.cache.get(guild.guildID).name)
}
is this a valid way to change all of one map value?
Why voting event isn't working
if(rmentioned = !message.guild.roles) return message.channel.send(Erole)
What should i substitute message.guild.roles with??
what are you trying to do
uh
wait
im creating a give roles command
whenever i type a non role
it does this and crashes
wait
how can i detect if its a role or not
@mild flower do the check if role existing in server
mentions.has
var role = msg.mentions.roles.first()
var member = msg.guild.members.cache.get(msg.author.id)
member.roles.add(role)
@mild flower, Search for roles by name using iterates over all roles
What version of discord.js u using?
0.14
if(rmentioned = !rperson.roles.cache.has(rmentioned.id)) i think this is correct?
wait
this is not what i wanted
If you get 429 on lavalink, how long does this mean you are limited for?
i dont know whats happening anymore
if(rperson.roles.cache.has(rmentioned.id)) return; message.channel.send(`:red_circle: ${rperson.displayName} already has that role!`)
no
how can i make it break if the if statement is succesful
remove the ;
ok
the ; after return should be at the end
if(rperson.roles.cache.has(rmentioned)) {
message.channel.send(`:red_circle: ${rperson.displayName} already has that role!`)
return;
}
you put the return before sending the message
wouldn't it be return message.channel.send();?
yes thats what i wrote?
yeah
what code do you have
finally someone who doesn't spam chat
i can't see whats wrong
hmm
thats not an ip logger lmao
bruh
r/wooosh
drop it again shadow
._.
mDBguilds.forEach(mguild => mguild.set(mguild.guildID, client.guilds.cache.get(mguild.guildID).name))
this isnt working (mDBguilds is an array of objects)
#shitepostoffice
?
ä
why do yall hate json files
how to edit single value of object
lä
why do yall hate json files
json succ
why
is there no way to see if the variable entered is a role in the guild or not?
why what
oh i thought you were gonna help m-
its a bit slower than db
my issue is that i dont know how to edit a single value of an object
object['thing'] = "yes";
what is the object?
array.forEach
?
yeah
no forEach pls
i wanna replace ID with name and i have got those values
for loop
idk how to pot the thing and the thing together
client.on('message', msg => {
if (!msg.content.startsWith(prefix) || msg.author.bot) return
var role = msg.mentions.roles.first()
var self = msg.guild.members.cache.get(msg.author.id)
var args = msg.content.slice(prefix.length).trim().split(' ').filter(item => item !== '')
if (role) args = args.filter(item => item !== role)
var cmd = args.shift().toLowerCase()
if (cmd === 'role') {
if (self.roles.cache.has(role)) {
message.channel.send(`:red_circle: ${rperson.displayName} already has that role!`)
return;
}
self.roles.add(role)
})
lemme pull up the discord docs 1 sec
discord.js u mean?
lost i just want to replace the thing with the other thing
i have the data of both idk how to replace
you've only got the guild id, and you want to replace it with the guild name?
u confuse me
x = { bob:1 }
how make bob 2
i dont understand
i want to make x.bob 2
u got: js x = { bob: 1 } and u wanna change it to```js
x = { bob : 2 }
yes
x['bob'] = 2
ok ty
i still hate canvas. time to start with Discord.net
let x = { bob: 1 };
x.bob; // 1
x.bob = 2;
x.bob; // now 2
👍
nice
how do i detect if the variable is a role in the guild?
if(rmentioned = !message.guild.role.has(rmentioned.id)) doesnt work
!= is doesn't equal
how do i detect if the variable is a role in the guild?
if(rmentioned = !message.guild.role.has(rmentioned.id))doesnt work
@mild flowerif(message.guild.roles.cache.has('role id')) { // TODO role existing }
also can use !!message.guild.roles.cache.find(r => r.name == 'role name')
Cannot read property 'has' of undefined
@mild flower Means that role is undefined
shadowblazer r u on djs11 or 12
14
lol

XD
what's your discord.js version, Shadowblazer
??
require('discord.js').version
guild.roles.cache.has(role)
im pretty sure its latest
guild.role.cache.has(role)
@void vale roles
ok
Cannot read property 'cache' of undefined
im pretty sure its latest
@mild flower Then use it ||https://discordapp.com/channels/264445053596991498/272764566411149314/738357901047103530||
it is not v12
since it doesn't support cache
k
Cannot read property 'cache' of undefined
@mild flower I think you are using discord.js v11, or guild object is not defined
i think he is on djs11 too
he probs just copypasted it
or ^^
without making it the guild object
@mild flower try to remove the cache.
yeah
msg.guild.roles.cache.has(role)
//or
var guild = client.guilds.cache.get('id');
guild.roles.cache.has(role)
why
why not
put || there instead
message.member.hasPermission("MANAGE_ROLES") && message.member.hasPermission("ADMINISTRATOR")
ok
instead of
pretty sure thats not the issue tho?
why
@mild flower Because of


