#development
1 messages ยท Page 436 of 1
and check if they have voted?
yes
yes
kk
kk
const can only be used once. if you use it here you will get errors everywhere
inside the loop yes, on every message
oh we looping
Thanks it worked ๐
vscode really helped
xd
vscode helped alot xD
you're doing good, keep learning
vscode is handy
Now do I just make another discord account to test if it won't send with a non-voter?
or wait 24 hours for the vote to reset
or someone else vote
Vscode has awful definition lookup time for me
that's one of the downside
lmao link blocked by malwarebytes
discord's preview still works tho
i can see the graphs
just cant read, too small
Worked
nice
There are a lot of libs for that
you can use something like jimp or canvas
member.addRole
thanks
It didn't actually give the role
(node:23376) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Supplied parameter was neither a Role nor a Snowflake.
What did you put
message.member.addRole('HONOURED')
I don't think that's resolvable
It has to be the role var or id
oh
guild.roles.find('name', 'HONOURED')
do I type exactly that?
Well that's the gist
You have to mod it if necessary
Actually
message.member.addRole(message.guild.roles.find('name', 'HONOURED'))
try that
You can also find the ID by pinging and appending a \ before it
Didn't work
what's the errno
(node:23565) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Missing Permissions
(node:23565) [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.
Does the bot have manage roles
And the bot's role need to be above the role it's trying to assign
learned it through my bot: https://discordbots.org/bot/reaction-role
literally only handles roles ๐
Wait
Oh yes
the role for bots is bellow the role I want to give
Thanks it worked
yeah too many people come into my support server with that error
lol
Wait
I need to change it up slightly maybe
Is it possible to constantly check if the user has voted, and after the 24 hours when the vote runs out, remove the role from them?
webhooks
Yeah you better off storing the data you get from webhooks
Massive querying API isn't great
webhook will tell your bot if one voted
Ill be fine with this
Webhook -> Store -> Assign Role | 24 H Job -> Clear Store
imagemagick
and is there an else in javascript?
lol what
if(isGay) {} else {}
I want to give an error message if the user hasn't voted
(isBigGay) ? 'U have big gay' : 'u have a non-big gay'

no
No 
im not port-fowarding
oof
And it won't work after you exceed certain votes
1000?
yeah like 1000 total
I will never get that many

Is that in a day or ever?
i think ever
lol
whats the easiest?

I want to be able to change the text
go with fabric
kk
they have plenty of tutorials
npm i fabric
or yarn add fabric
so far


lol
Could someone explain how to change the colors of the "Invite" and "Vote" buttons on your bot's DBL page? I'm assuming you have to use HTML in the long description?
@vernal crow yeah style tags
Can you even use html in your long desc?
I have a style tag for background color
yeah you can
I thought it was just markdown
oof
@vernal crow Depending on the css hierachy, I needed to use !Important for some
I'm pretty new to HTML and CSS, so I'm not sure how to change attributes of the buttons directly.
Can I please help you with this one
Can I share the HTML I have so far?
chromebook 
Ok
background-color: #69EDE6;
}```
@vernal crow yeah sure
@keen drift Can I help him with this one
go ahead
That's excluding the HTML tags surrounding it
not like I'm fighting to help people 
@vernal crow Link your bot page
Invite and Vote
Wait what
Just like this https://discordbots.org/bot/reaction-role
K gimmie a sec
Yeah.
OK I see
This one just does simple HEX colors for the buttons, which is what I'm looking for
If you inspect it
I think
and get like the style code or whatever
@keen drift I need a little help
already 
I may have found something

So, Multi mentioned inspecting. Which I tried earlier. This time I may have found it.
There's like 800 style tags
It's pretty easy once you get used to it
But one is for long description
I'm completely lost with fabric
How do I make it actually send the image
embed
client.on('message', message => {
if (message.author === client.user) return;
if (message.content.startsWith(prefix + 'square')) {
// reference canvas element (with id="c")
var canvasEl = document.getElementById('c');
// get 2d context to draw on (the "bitmap" mentioned earlier)
var ctx = canvasEl.getContext('2d');
// set fill color of context
ctx.fillStyle = 'red';
// create rectangle at a 100,100 point, with 20x20 dimensions
ctx.fillRect(100, 100, 20, 20);
}
});
?
yeah you can work on other stuff meanwhile 
Node canvas is based off html5 canvas
"document" doesnt exist in node.js, there is nothing to display
when working with canvas in node.js you're actually working on a virtual canvas
you have to create it first, and then work on it
just follow the instructions of whatever canvas lib you're using
Let's say I wanted to Shard and I wanted to restart all my shards at once with the eval command. Would I go
process.exit()
or
client.shard.broadcastEval(`process.exit()`)
?
the commands for my bot isnt working what should i do
``from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
import time
import discord
Client = discord.Client()
client = commands.Bot(command_prefix = "p!")
@client.event
async def on_ready():
await client.change_presence(game=discord.Game(name="Do p! okay? mmk"))
@client.event
async def on_message(message):
if message.content == "p!Info":
await client.send_message(message.channel, "Penguin Helper Version: 0.0.2 Created by Musicmanlogo#6435 Coded by Penguin#7006")
@client.event
async def on_message(message):
if message.content == "p!Help":
await client.send_message(message.channel, "Here Are The Commands help,info,ping,summon Prefix p! More Commands Coming Soon!")
@client.event
async def on_message(message):
if message.content == "p!Ping":
await client.send_message(message.channel, "Ayy! No Ping pingdy ping ping oh you meant Ping Pong thing okay Pong!")
@client.event
async def on_message(message):
if message.content == "p!Summon":
await client.send_message(message.channel, ":scream: WHO SUMMONED TH- :neutral_face: Oh Thats Me? well Then WHO SUMMONED ME!")
@client.event
async def on_message(message):
if message.content == "p!RAnime":
await client.send_message(message.channel, "Anime I Recommend is One Punchman its pretty good")
client.run ("You.aint,Looking,At.My.BotToken")``
K ill let you know whats wrong once I read it
I don't really know python but
ยฏ_(ใ)_/ยฏ
I think I see your problem
Either remove 1 = from the message.content or add 1
Try that
I think you have to close the command
or try this :
@client.event
async def on_message(message):
if message.content === "p!Summon":
await client.send_message(message.channel, ":scream: WHO SUMMONED TH- :neutral_face: Oh Thats Me? well Then WHO SUMMONED ME!")
See
I added an extra =
or remove 1
try both
did you try both?
yes
nope
Well, In java, say I do this :
client.on
if message.content.startWith(prefix + 'oof') { - This opens
message.channel.send('yes, oof')
} - Note that this closes
idk what it is in python
k
k
k
I suggest maybe just switching to java
I can give you a simple starting script
ik this isn't the best option
but watch this video
Welcome back to another amazing viewer request episode, this time you guys have been asking about how to host your bot on glitch.com. So, watch the video and...
this way the bot will always be online
if you do this
ok
Or do this
if you want to continue with python
discord_bot.py - ๐บ A simple discord bot that helps you get started within discord.py
kk
does anyone know how i can convert an array of maps into one single map using javascript?
@austere meadow By an array of maps do you mean something like:
// from
[{a: 'foo', b: 'bar'}, {c: 'olga', d: 'ree'}]
// to
{a: 'foo', b: 'bar', c: 'olga', d: 'ree'}
yeah basically
if you need some context behind it, i've just recently started sharding and i want to add all of the users from client.users together
so that i have all users across all shards
Looking at the docs for discord.js you might be able to do something like
// obviously with better variable names
const allUsers = thatShardList.reduce((first, second) => {
first.concat(second);
});
// or
const allUsers = new Collection().concat(...thatShardList) // I think that's how you use the spread syntax
This is what I was looking at https://discord.js.org/#/docs/main/stable/class/Collection?scrollTo=concat
Assuming I remember correctly, the second example should work.
Or you could do it the not-so-complicated way
Just get the array of all the users
join them
and make a new collection
new Collection([array])?
Or just concat tbh
const allUsers = shard1.users.concat(shard2.users, shard3.users, shard4.users)
hmm
i like @glossy mason's way of doing new Collection().concat(...thatShardList)
Well both are the same
i'd need to loop over thatShardList though wouldn't i
yeah
what is thatShardList, is it the array of maps
Yeah, was just trying to think of a name. It'd be the array of the user collections from each shard.
no its not
I think
According to d.js docs https://trying-to.get-a.life/cJoyysH4.png
since a Collection extends a Map and Maps are basically just fancy objects
can i do Map.assign()
because the problem is im having trouble bringing the maps together into one array
im just getting [object Map][object Map] as a string
or am i just being blunt
Yeah collections extend maps
What part of that screenshot of the docs makes you "think not"?
@earnest phoenix u pinged me?
nooooo...
Just wondering if you figured out the embed image thing thats all
sorry
i can see deleted messages 
lol
someFunction(array1, array2, array3);
// is the same as
let bigArray = [array1, array2, array3];
someFunction(...bigArray);
I'll look at it now, just finished a section of my other project: https://illuminate.ngrok.io/5b2f332ec1fa0b0f2ea031e0.png
Looks complicated
more like just much of garbled data
@glossy mason @fluid basin thanks again for all your help
but i've decided to just give up on it;
my plan would never have worked because broadcast evalling "client.users" across all shards would produce duplicates, and it would be too hard to combine the UserStore maps together
I think 100 servers is one of them
The use of at least one of our widgets on your website/github page. (Get widgets for your bot by going to your bot's profile and pressing edit)
oo p s
i don't think I did that 
wait what happened to those messages

Soooooo.. I've been working on my reminder bot, and so far its going.. ok. Reminders are pushed to the reminders array, and thats good. But when a reminders over, it just keeps DM'ing me over and over and the code won't remove it from the database/array.
Here's the code:
const humanize = require('humanize-duration');
let reminders = [];
exports.handler = async (client) => {
// monitor reminders
setInterval(async () => {
reminders.forEach(async reminder => {
let time = new Date(reminder[0].setAt).getTime() + reminder[0].remindAt;
if (new Date().getTime() >= time) {
let user = client.users.get(reminder[0].id);
if (!user) return;
user.send(`${humanize(reminder[0].remindAt,{largest:1})} ago, you asked me to remind you this: \`${reminder[0].title} :tada:`);
let data = await db.table('reminders').get(reminder[0].id);
let newArr2 = data.reminders.splice([data.reminders.indexOf(reminder[0])], 1);
let newArr = reminders.splice(reminders[reminders.indexOf(reminder)], 1);
reminders = newArr;
await db.table('reminders').get(reminder[0].id).update({ reminders: newArr2 });
console.log('end of reminder')
}
});
}, 3000);
}
Any help is appreciated, I seriously can't figure it out ;-;
Idk man
and to classify "it keeps going":
Maybe its the await
it seems like you never remove the entry from your reminders array
Jesus nested forEach with async
you remove it from the database but never the variable
I am removing them though
let newArr = reminders.splice(reminders[reminders.indexOf(reminder)], 1);
reminders = newArr;
are you sure newArr is what you're expecting
It should be, I'm going off the mdn array docs
that splice returns a new array
and I'm setting reminders as the new array
what's the array length
1
hmm
at all time?
only one reminder is in there
yeah since I've only added one reminder for testing
when its DM'd the user, its supposed to remove it from the database and array
so it empties
So my take on this is the nested async callbacks
Anyone know how I could make premium commands for my discord bot?
use a database
It's generally not a good ideal to nest callback like that, not to mention async ones
@keen drift I honestly dunno how to do it, so, this is just an attempt, if you have another way to do it I'd love to hear it xd
If you change setInterval to setTimeout, will it repeat?
So it never dms you more?
it's clear that something is wrong with your code that deals with removing the reminder, i think you should check if newArr is returning what you're expecting
running your code (similar to it) in my case never removed the first item from g https://please.zbot.me/EciWnWnn.png
it's because your indexOf is probably returning -1
Yeah it might be
so log newArr?
Anyone know how to make your discord bot page icon expand when you hover over it?
Try
ok
you can log newArr but your reminders.indexOf is returning -1 meaning it couldn't find that entry
I also would advise getting rid of this nested async callback, it can have unintended side effects
@wild tide No I don't
newArr is apparently the same as reminder: ๐
@sick cloud found the problem,
change
let newArr = reminders.splice(reminders[reminders.indexOf(reminder)], 1);
to
let newArr = reminders.splice(reminders.indexOf(reminder), 1);
akright
there's no need for the reminders[] around the indexOf
that just returns the value of whatever is at that index which isn't what you want
you just want the index
Hey fishy
okay, gonna try it
Also if you use async block, you must check for > -1, array access order is not guranteed
nope @austere meadow it keeps repeating and not removing
logging newArr with the new code gives this:
@earnest phoenix Uh, shouldn't
ok what i'd suggest

change reminders.forEach(async reminder => { to reminders.forEach(async (reminder, index) => {
this way you can track the index that the forEach is currently on
then just do let newArr = reminders.splice(index, 1);
that will 100% work and it's faster since you aren't relying on indexOf
no that shouldn't be an issue
alright
it's just better to use the index
Is there a way I can get the amount of users my bot is watching throughout all guilds the bot is in?
client.users.size?
@earnest phoenix client.users.size
Thanks
if sharded, you must broadcast or fetchclientvalues
forEach index is still not reliable enough in this case
if another async function were to complete before the first
the foreach index would be off
oof
sec
.-.
This is quite trivial because of the async nonsense
setInterval(() => {
reminders.forEach(async (reminder, index) => {
let time = new Date(reminder[0].setAt).getTime() + reminder[0].remindAt;
if (new Date().getTime() >= time) {
let user = client.users.get(reminder[0].id);
if (!user) return;
//user.send(`${humanize(reminder[0].remindAt,{largest:1})} ago, you asked me to remind you this: \`${reminder[0].title} :tada:`);
let data = await db.table('reminders').get(reminder[0].id);
let newArr2 = data.reminders.splice(index, 1);
let newArr = reminders.splice(index, 1);
console.log(newArr);
await db.table('reminders').get(reminder[0].id).update({ reminders: newArr2 });
reminders = newArr;
console.log('end of reminder')
}
});
}, 3000);
thats how it looks now btw
also trying to prevent if db operation doesn't complete within 3 seconds, don't start another one
RethinkDB is pretty quick, doesn't take too long to operate ๐
let's hope so
const humanize = require('humanize-duration');
let reminders = [];
exports.handler = async (client) => {
setInterval(async() => {
for (reminder of reminders) {
if (new Date().getTime() >= time) {
let user = client.users.get(reminder[0].id);
if (!user) return;
user.send(`${humanize(reminder[0].remindAt,{largest:1})} ago, you asked me to remind you this: \`${reminder[0].title} :tada:`);
let data = await db.table('reminders').get(reminder[0].id);
let newArr2 = data.reminders.splice(data.reminders.indexOf(reminder[0]), 1);
reminders = reminders.splice(reminders.indexOf(reminder), 1);
await db.table('reminders').get(reminder[0].id).update({ reminders: newArr2 });
console.log('end of reminder')
}
}
}, 3000);
}
This is my version, so far
not sure if it makes a difference
trying to cut down on async blocks
Can someone help me with a prefix changing command?
@earnest phoenix get a database.
^
Multi Raxerz I literally just coded that command today lol
Does it cost money to get a database?
Google is your friend
smh no
No...
Just host a Rethink instance like I do. Rethink = <3
Sql is life

where is time defined
since you didn't include the time code nwn
let time = new Date(reminder[0].setAt).getTime() + reminder[0].remindAt;
and the code with the time thing breaks anyways
same error as with mine
@keen drift thats with time added. ^^
Do you have the output of newArr2
do you want me to console log it?
yeah
is reminder an array?
yes
I thought it was a single object
wait
what's reminders then
no
or yes idk
reminders is an array
thats why time is let time = new Date(reminder[0].setAt).getTime() + reminder[0].remindAt;
reminders**[0]**
i think each reminder is popping up as an array of its own
dunno why but thats how it is
can you log reminders
yeah hold on
@keen drift
so its an array with arrays containing objects in them i guess xD
thats how the database handles it though so i just rolled with it
these data structure mixing is actually confusing me
Do you have to insert newArr2 into the database, the spliced reminders wouldn't work?
dunno

.<
when u don't know ur own code
reminders(array):
[
[ { reminder 1 } ],
[ { reminder 2 } ],
...
]
thats how reminders are stored
yes

yeah
i guess? ๐

u killing me tony
const humanize = require('humanize-duration');
let reminders = [];
exports.handler = async (client) => {
setInterval(async() => {
for (reminder of reminders) {
let time = new Date(reminder[0].setAt).getTime() + reminder[0].remindAt;
if (new Date().getTime() >= time) {
let user = client.users.get(reminder[0].id);
if (!user) return;
user.send(`${humanize(reminder[0].remindAt,{largest:1})} ago, you asked me to remind you this: \`${reminder[0].title} :tada:`);
reminders = reminders.splice(reminders.indexOf(reminder), 1);
await db.table('reminders').get(reminder[0].id).update({ reminders: reminders });
console.log('end of reminder')
}
}
}, 3000);
}
t r y, I removed the duplicate
if it's the same, it should work still
give me a Basic Visual Studio Code
Basic Visual Studio Code
@sick cloud so I'ma goto sleep, lmk if you still have the problem tomorrow
@earnest phoenix I also will get on your thing tomorrow, currently 4am here
Hey
and it's message.react
kk
(node:16797) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Unknown Emoji
Do I have to give emoji ID?
Ok got it working ๐
๐
Do you know how to do image manipulation, like in #265156361791209475 when a new user joins?
language?
JS
@proud folio
Go and learn how to install a module and install our dblapi.js module, then create an event in DBM, i recommend "Bot Join Server" & "Bot Leave Server" or you can use "On Interval", create a Run Script inside it and use this code:
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);
dbl.postStats(client.guilds.size);
console.log("DBL stats updated.");
๐
@steel heath Should i insert my token where it says 'Your discordbots.org token?
You have to insert your Discord Bot List token (that you can find in your bot's edit page or https://discordbots.org/api/docs#mybots here)
Yeah, you'll see your server count if you did it right in your bot's page
What event you used?
No, it's good but you know that event triggers when someone adds your bot to a server, so you have to add your bot to send the count
Okay
Do you know how to do image manipulation, like in #265156361791209475 when a new user joins?
which lang
Js
when i run nodemon it doesnt start. any fix?
looks like it started
You mean you have a line in your code that logs to the console that it started? If thatโs the case then we would need to see your code... nodemon is working fine there...
@steel heath you don't need postStats if you add the client in the constructor
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);
console.log("DBL stats updated.");``` you mean like this?
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
o, i didnt know these
those events are new in 2.1.0 tho
hello there. I'm looking for a bot there's able to list all members of a specific role. Is there anyone which know such a bot?
Something like X, Y, Z have role "Member"?
I'm not aware of one but you could always make one ๐
afk (oke I'll read all text later pls @ me if you have a bot #I'm not a developre #noob #sorry)
@compact moth @sly snow has .inrole command
One message removed from a suspended account.
fs.writeFile("./mutes.json", JSON.stringify(bot.mutes, null, 4), err => {
fix?
whats the error?
@earnest phoenix do you even have a commands folder
also
thats a plain string
not a template literal
One message removed from a suspended account.
it has to be a template literal 
One message removed from a suspended account.
does it have on the docs?
One message removed from a suspended account.
oh yea typo
One message removed from a suspended account.
One message removed from a suspended account.
um make a command file?
One message removed from a suspended account.
so code your command
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
const x = 10
const a = `x = ${x}`
const b = 'x = ${x}'
const c = "x = ${x}"```
a is x = 10
b and c are x = ${x}
Also one of the strings literals you put () instead of {}
cuz bot is already defined
Around the variable
One message removed from a suspended account.
One message removed from a suspended account.
Does addfield need to be addField
You also are using bot as your discord client.. then at Servers in that embed field.. you use client.guilds.size
One message removed from a suspended account.
what do you think it needs to be?
You havent definied client at all.. so that would return a null reference exception
he is just following a tutorial also
anyone know a way to make a database for C#/d.net where someone can use a command to ask a question to a server staff member, and it gets posted in a certain channel?
so there's gonna be a "setup" command a server owner can use, where all the questions can be posted
was just gonna say "unless you wanna do ^"
One message removed from a suspended account.
TheGreat. Definitely dont need a DB for that, unless you want the question permanently stored
try googling sqlite for c#
hm
Oh. And yeah i havent tried sqlite, ive been using mongodb.
ive been using sqlite
most popular databases are probably sqlite, leveldb and mongo
one of them should fit your needs
One message removed from a suspended account.
You dont need to define client
jim you're not using "client"
U already have a discord client defined :)
Thx to @slender thistle for the hint (nakedo works well๐)
Thegreat. Are you calling this code from a command? So probably using Context?
so there's gonna be a setup command someone with admin powers can use, where they basically just do /AJ/setup <#channel> and then anyone can use /AJ/ask <qestion>
Ok.. so setup.. obvioulsy send a query that saves the guild id and the channel id
yes
he just needs a db to store server preferences, including channel id for relaying questions to
On ask, get the id of the channel for that server
its gonna be different for each server though
Context.Guild.GetTextChannel (idofquestionchannel)
ok
Yeah which is why u will store channel id and guild id.. when someones asks.. you will query the db and find the askChannel of Context.Guild.Id
ok
whats the line of code to make it so that only people with administrator powers can use the command
Hmm.. been a while, one minute
ok
One message removed from a suspended account.
One message removed from a suspended account.
How I can change all the background of my bot page? (I know that I need to use css, but I don't know what I need to change)
Example of what I am saying
but what tags I need to change
use F12 to find them
I was supposed to have to do that xd
[RequireUserPermission(GuildPermission.Administrator)] @simple bramble
ok
One message removed from a suspended account.
One message removed from a suspended account.
Why the fuck would you ask. Just run it and see if an error shows up
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
You cant just have a bot online and it get accepted, you need working commands, along with other things
One message removed from a suspended account.
One message removed from a suspended account.
then keep trying
One message removed from a suspended account.
... you applied 10 times?
One message removed from a suspended account.
One message removed from a suspended account.
how did you count 10 times? did you give up on every try?
One message removed from a suspended account.
Copying a tutorial is a very small step to getting started. You should understand programming before just diving in. Use Google to your advantage
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
then you're not understanding the purpose of this website
is there any way to check now many servers ur bot is in?
One message removed from a suspended account.
One message removed from a suspended account.
besides the "you're bot is online in 2 servers" console.log
you dont just make a bot work and apply here.
to have done it in a while and from the mobile is not bad https://discordbots.org/bot/454272495114256394
One message removed from a suspended account.
you have to design something, have ideas, create features, code and test them out, until you have a proper bot that has working commands, that is usable by the general public. after you have all of that, then you apply
this is website for listing bots that are ready to use
One message removed from a suspended account.
not bots in development or in testing
but I can't find the tag of the "join support server" button
Use the documentation for the library.. i struggle with JS.. ive been coding for 10 years in different languages.
One message removed from a suspended account.
One message removed from a suspended account.
no you shouldnt
you should learn how to make your own
@frail delta yes, check the size of the guilds collection
tyvm
One message removed from a suspended account.
You can follow the tutorial to get the base of the bot, sure.. but you arent aware of objects being defined or not. I think you should take some intro to programming first.. there are some decent free hands on websites
you can follow him to understand how he did it and why, but not copy without understanding
One message removed from a suspended account.
in any case, making a bot requires dedication, you cant just give up everytime it fails
you have to learn why it fails, and fix it everytime it fails
because it is gonna fail, a lot of times
Also try to use an IDE like Visual Code, so you can debug
i've been developing my bot for almost a year, and it has failed and crashed thousands of times
but everytime it crashes, you learn, you investigate, you fix, and the bot becomes better and better
how do I change @everyone permissions with nodejs?
you want to change a server's everyone permissions?
@earnest phoenix are you familiar with any programming language?
yes @quartz kindle
I do want to change @everyone permissions
disable permissions from the @everyone role
check this https://discord.js.org/#/docs/main/stable/class/CategoryChannel?scrollTo=overwritePermissions
@earnest phoenix i dont think drag and drop coding will help you here. do you know which language was used when you did it?
msg.channel.overwritePermissions(msg.guild.roles.find("name", "@everyone"), {
SEND_TTS_MESSAGES: false,
MENTION_EVERYONE: false
})
hmm @quartz kindle
it doesn't work
garrrr
it overwrite the perms only for 1 channel
i dont know if you can change the everyone role
The @everyone role of the guild
Type: Role```
its read only
msg.guild.createChannel("Information", 'text',[{
type: 'role',
name:'Members',
deny:0x800
}])
also why this doesn't work?
it works with id...
which is weird...
Hi, I am looking for a changing "playing" code at a certain time. Could you give it to me?
Ok you can change it with client.setpresence
but I need code for the bot.js
your best bet would be searching the d.js docs yourself
I just need a code that changes the "playing" place at a specified time, not the sentence.
well it's not only about learning js, but also about not being lazy at opening the docs at least once
Did we ask?
What
You mean at a specific time like 14:00 or something like that?
var d = new Date();
if (d.getHours() == XX) {
// DO SOMETHING
}
Something like that?
I donโt understand what he means by place
maybe he meant "playing status"
I think he means the playing/watching/streaming etc... status
Yeah I think his question is really about how to do something at a specific time rather than changing the playing status. Either way, check the docs for changing the status and do some sort of check for the time and change it accordingly. (:
In c#/d.net, how do I make itโs playing status have its server count in it
For example, โtype /AJ/help | <servers> serversโ
Use the Client.SetGameAsync("Insert some game text here"); function
Just add it to the string like you normally do
So I would manually have to put โ2 serversโ instead of it automatic
p!search bts
@earnest phoenix does this look like a testing channel
The client has a Guilds() object so use that and get the count from it
Ok
And that would be?
const dbl = new DBL('YOUR NOT SEEING THIS REEEE', client);
client.on('message', message => {
if (message.author === client.user) return;
if (message.content.startsWith('snipers checkvoted')) {
const id = message.author.id
if (dbl.hasVoted(id)) {
message.channel.send('You have been given the HONOURED role!')
console.log(id + ' has voted!')
message.member.addRole(message.guild.roles.find('name', 'HONOURED'))
}
}
}
)
This still sends the message
Even if they havenโt voted?
Yes
Hm
This user has no bots
Yeah I donโt have bots yet
-bots @earnest phoenix
@pallid void
What?
Don't use Luca here.
I asking a dev question
Iโm reading it, give me a minute
ok
Yea there is no reason that should be broken unless you are doing something else
There was no point in doing that, honestly.
Oof
What lang/library is this
dblapi.js :^
Iโm not a fully experienced coder, but I might have found the problem
kk
Are IDs stored as strings or integers in hasVoted?
Why do you need to add a role
Yea that could be the issue
Itโs probably no use then
Well
what could be the issue?
And it may be the role thing then
What it's doing is, Sending the message, but then not adding the role to a user who has not voted.
If they have it does add the role
Does the bot have add/manage role perms
Yes
Does it send the message even when they didnโt vote?
When does it send?
So itโs a command?
He hasn't voted
You don't?
@earnest phoenix hasVoted returns a Promise
It does?
So how do I cancel, if not?
dont cancel 
handle the Promise correctly
use async/await or .then()
how comes that you make a bot then if you dont know basic concepts of js 
Were should I locate the async?
That's literally me back in the days when I was trying to edit my Red bot. Enough of my off-topic now, I am out of this channel, sorry.
read this up and you should understand what Promises are and how you handle then
you just leaked your token
Rip key
dont do that
oof
Reset it.
Reset it
kk
stupid me
client.on('message', message => {
if (message.author === client.user) return;
if (message.content.startsWith('snipers checkvoted')) {
const id = message.author.id
if (dbl.hasVoted(id)) {
async
message.channel.send('You have been given the HONOURED role!')
console.log(id + ' has voted!')
message.member.addRole(message.guild.roles.find('name', 'HONOURED'))
}
}
}
)
Would async go there?
no
oh
just read up what i sent you
I literally learn't nothing
..
setTimeout(function(){
The message script here?
}, 250);
});
???
I'm just doing what it says
that doesn't change that you need to learn for yourself and we wont spoon you code
oof k
take time to learn
I don't need this code. It's just useless
you read it so you understand an actuall concept of programming
yea you can make that if you actuall understand Promises
but seems like you dont wanna understand it and just copy&paste shit
Come on glitch, time to rewind
dblapi.js - An official module for interacting with the discordbots.org API
it returns a promise
which is a truthy value
as in if(somePromise) is the same as if(true)
wait what
and then i said he should properly handle the promise
so I always get true when I have it in if()?
yes because it returns a promise what is always a truthy value
handle the promise

Any good JS guides around, btw?
anidiotsguide is decent
bot.on('messageReactionAdd', (reaction, user) => {
console.log(`${user.username} reacted with "${reaction.emoji.name}".`);
})//this works
bot.on('messageReactionRemove', (reaction, user) => {
console.log(`${user.username} removed "${reaction.emoji.name}".`);
})//this fails with "Cannot read property 'emoji' of undefined"
Does anyone know what the difference is?
I mean why it would work with adding and not removing
lol
they both should return exactly the same object
read the comments in the code
It should be returning the removed emote but its saying its undefined hmmm
do you use the raw event @granite hedge
yeah
hah






because you fucked even more stuff up
