#development
1 messages · Page 1228 of 1
sometimes u talk nonsense
nah maybe he is in work
its not centering....
@fervent goblet try posotion: fixed
i was talking about code913, ace
left: 50%;
sometimes u talk nonsense
@digital ibex i also sometimes code at skool
can anypne help me with pollow?
pillow
im doing a progress bar
but i can get it to go into the correct spot
Ok, show your code
yeah
how would I make a json file on a bot joining a new server
don’t
why
use a database
eh
why use them then
i just thant a json for each server that just has the prefix in it
and that isnt enough reason for me to use a db
what language are you using?
js
and that isnt enough reason for me to use a db
@wooden ember yes it is
sry forgot to mention that
I use a db for that
why thojust for one reason
tell that to some guy I met that has an entire economy system that uses json
Hello
mmm
over 5k files
@wooden ember
suck a horses dick
qdb is a rapper for my sql isnt it
sqlite3 iirc
ah yeah
use fs, @wooden ember
mongodb’s cool too if u’re into that
bruh just use quick.db or something
yeah but can that make a file tho
that saves data in a json
oh no
my mind is retard 101 today
who said json db

u want to see the code?
use real db (or if you have enough knowledge, go make ur own database (real database, runs with binary for example))
u guys need to chill, like fr. if he wants fo use it, let him use it
how would I make a json file on a bot joining a new server
i just thant a json for each server that just has the prefix in it
this is what i use to make the rank card
ok
i want to have a progress bar
this is the card
Im trying to make an app that when someone is buying something trough paypal, it will auto pay to two people using paypal api, for example someone paid 3$, it will be paid to
general-mail@gmail.com, so with paypal api it will pay 1$ to submail1@gmail.com and another dollar to submail2@gmail.com, how to do it ?
stripe might be able to do that
you are talking to me ?
can anyone help?
make a progress bar?
Question. So, if I make a bot, and publish it to top.gg and it gets accepted, am I allowed to create 'devchannel' command that shows my channel
you dont have permissions here to do so @prisma wraith
I mean, on my bot
bots added here only have 2 or 3 perms iirc, send messages, read history and embeds
i mean, its ads but i guess you can if the user requests it
not something automatic
like !mychannel
then it displays it
Not automatic, they say t$devchannel and it shows my channel (I created bot)
should be fine

👍
have any of you registered a .bot domain with a discord bot?
no but do you need help
yes, if you have a .bot domain lol
I believe you need ssl for a .bot domain, so you'll have to set up something like nginx
Has someone experience with pm2?
Me
Me
it's behind verification, hence why I need someone that already has it
cd into the folder => pm2 start <main bot file>
Khaaz, I'm confused what do you want to do
@pure lion perfect I have a question
I am starting my bot
but for a reason the pm2 always creates 2 processes
if you don't own a .bot domain, it's normal for you to be confused.
wuts floodfill?
Oh that's sick
@forest epoch you need to end all instances of your bot and then run it
Are you hosting on a vps?
yes you told me
Imagine pinging two people for absolutely no reason
yep
ok I try that. I have a Idea where it comes from now
I always use pm2 start node index.js
but I do not need to write the word "node" right?
No
no
Hey,anyone know how to get the total users of my bot not just the online ones?
for changing custom statuses of a bot what is the discord api rate limit
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
"The maximum frequency you can change your status is 5 times per 20 seconds (approx. every 4 seconds); any faster than that is considered as Discord API Abuse. We suggest you change it to something more reasonable, such as every 120 seconds."
but personally i wouldn't change it anywhere near that
@sharp thicket what library?
i change mine every 24 hrs:)
plez lol
discord.js
Bots can't have custom statuses.
they can
No.
i only need the progress bar
why is it a value then?
Kora wdym
they can’t set custom statuses
its a game that you can set
@sharp thicket they can be "playing" or "watching" or "streaming" and shit but not have a custom boye
bot.user.setPresence({ activity: { name: With Avio Developers | ${config.prefix}help | Avio Help, type: "CUSTOM_STATUS" }, status: 'dnd' })
the custom status is that what we have
i never tried it
"The maximum frequency you can change your status is 5 times per 20 seconds (approx. every 4 seconds); any faster than that is considered as Discord API Abuse. We suggest you change it to something more reasonable, such as every 120 seconds."
- #mod-logs
@thick gull thanks I am changing the time it was 5sec now btw
Yeah, because it's in the enum/types. You can't actually set it as your presence.
Hey,anyone know how to get the total users of my bot not just the online ones?
@sharp thicket anyone though
You could try it and see it fail.
oof everyone went away
const browser = await puppeteer.launch({
defaultViewport: {width: 1920, height: 1080}});
const page = await browser.newPage()
await page.goto('https://sa-mp.im/server/war-stats/22/cuneo-vs-triads')
const element1 = await page.$eval('#nav_righter > div > div > div > div.center > div > div:nth-child(1) > h3', el => el.textContent);
const element2 = await page.$eval('#nav_righter > div > div > div > div.center > div > div:nth-child(3) > h3', el => el.textContent);
var amountString = element1;
var amount = amountString.replace(/\./g, '').match(/^.*([0-9]{10})/)[1]
var amountString2 = element2;
var amount2 = amountString2.replace(/\./g, '').match(/^.*([0-9]{9})/)[1]
var x = amount - amount2;
const element3 = await page.$eval('#nav_righter > div > div > div > div.center > div > div:nth-child(3) > h3', el => el.textContent);
var amountString = element3;
var z = amountString.match(/^.*([0-9\.]{10})/)[1]
await browser.close()
return {diff: x, triadlost: z};
};```
``` let {diff, triadlost} = wardiff(x, z);```
(node:1092) UnhandledPromiseRejectionWarning: ReferenceError: x is not defined
what's incorrect here
You haven't defined x
so console.log(x)
wait sec
i think i fucked up something ye
so console.log(x)
@pure lion undefined
btw i changed let {diff, triadlost} = wardiff(x,z); to let {diff, triadlost} = wardiff(); it was dummy mistake i had those x,z but im not using them
@earnest phoenix 👀
@granite echo lmao
👀 stop following me god damn
like the white name that I am
How get the number of the servers my bot is
bot.guild.size?
Js
I forget simple lines of code im stupid
then re learn it
Cannot read property 'size' of undefined
anyway if ur v11 whats before size is undefined im p sure u can work that out
OwO ok
use v12
and that
do the topgg webhooks send json
sorry im an idiot ;tm;
ok sure I’ll try it

do the topgg webhooks send json
@thick gull
yep
okay
do you have an example i can see so i can see if its even possible to use ifttt with it
for what? server votes?
yea
ty
//value = @pliant gorge;
return value.split("<").split(">").split("@").split("!");
TypeError: value.split(...).split is not a function
at module.exports (/home/thinh/Programming/judger-djs/tools/mentions.js:6:41)
Help me
{
"webhook": "http://the.webhook/url",
"webhookAuth": "your secret authorisation",
"guild": "264445053596991498",
"type": "test",
"query": "?test=data¬RandomNumber=8"
}
@thick gull
thanketh thee
oh
yes
You can use regex for that
regex ?
Regular expression
Yeah, discord.js even provides you with a regex to use
and what is that
It does?
yup
:o?
Yup (@earnest phoenix)
Idk what's the problem apparently it cant read the length of the aliases
let fetch = require("node-fetch");
fetch(`https://space-bot-list.xyz/api/bots/${client.user.id}`, {
method: "POST",
headers: {
Authorization: "your sbl api key",
"Content-Type": "application/json"
},
body: JSON.stringify({ guilds: client.guilds.size, users: client.users.size })
}).then(req => req.body);
can someone convert this to py?, idk py but its for another bot list, and im not learning py just for this if i aint gonna use it again
Send code
yea just pay me and ill convert 
Both
const {MessageMentions} = require("discord.js");
MessageMentions.USERS_PATTERN // Regex for matching user IDs
google is ur friend
A static property of the MessageMentions class
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
u can find docs of regexes on there
using PILLOW, can i replace a color?
escrever.rectangle((311, 250, 122+(int(cur_xp/xpneed*100)) * 2, 25), fill=(255, 255, 255, 255))
i want to replace a color and put the bar
@pure lion
know whats annoying?, people pinging for support, just saying
I was waiting before I pinged
¯_(ツ)_/¯
And this error is getting annoying
how much of js do you know?
https://google.com/
@granite echo please don't just tell people to google it themselves, it's unhelpful. lead them to useful resources instead. otherwise just don't answer
https://canary.discordapp.com/channels/264445053596991498/272764566411149314/670727029540519937
lol
How do I get a response of “Command not found” for commands I don’t have? Using Python
Is this a bot farm?
** BOT-TO-USER IMBALANCE **
Admins (74)
Total Users: 99
Bots to Users ratio: 89.90 %
Real Users: 10
Bots: 89```
Probably
I see others too, but it's hard to tell
Admins (28)
Total Users: 80
Bots to Users ratio: 71.25 %
Real Users: 23
Bots: 57```
I mean think about it: does a user really need 89 bots in their server
when only 10 people are there
Hi,so im using the "guildCreate" event but how do i define the guild that the bo was added to? (discord.js)
I see some that are 50/50 up to 40 users
It's the first parameter Kora
what do you mean?
Like js bot.on("guildCreate", (guild) => {...})
Anyone wanna code a Discord Bot and its own Dashboard( TypeScript, MongoDB ) IM SO BORED
what would "a Discord Bot" do?
if it was in js maybe
lol
?
different tho it uses import which i aint use to
can someone help me or suggest somewhere to learn how to put like server names and stuff into embeded welcome messages please
Do I need to use forEach for user.presence.activities.type === 'LISTENING'
@client.event
async def on_member_join(member):
channel = client.get_channel(channel id)
await channel.send('A new member arrived! Let us welcome {member} to {guild.name}!')
role = discord.utils.get(ctx.guild.roles, id = (role id)
await ctx.add_roles(role)
Want to make a welcome message and auto role function in one, what do i need to edit for the ctx in the role function?
Py?
yeah
@acoustic bridge for a begining you can get the role using role = member.guild.get_role(role_id) and to add a role to the member it is member.add_roles(role) https://discordpy.readthedocs.io/en/latest/api.html?highlight=add_roles#discord.Member.add_roles
I see, so it would've work with member.
yeah you cant add roles to a context object
not that you can get a context object in that case anyway
also you forgot the f in front of the string
ahh that was intentional
oh
i wanted to make an embed welcome message
and had to edit so the embed stuff wouldnt flood the chat
ah ok i see now
hey guys
(node:11812) UnhandledPromiseRejectionWarning: ReferenceError: location is not defined
i don't know why this happens
let [skytext] = msg.slice(prefix.length).split(" ");
console.log('Searching locations with:', skytext);
let locations_found = await get_location_by_skytext(skytext);
console.log({locations_found});
if (locations_found.length === 0)
{
return message.author.send("<@" + message.author.id + ">" + ' ```No locations have been found!```');
}
let embed = new Discord.MessageEmbed()
.setDescription("**Weather type:**" `*${location.current.skytext}*`)
.setTitle(title);
locations_found.slice(0, 10).forEach(location =>
{
embed.addField(
`${location.current.observationpoint}, ${location.location.lat}, ${location.location.long}:`
);
});
embed.setThumbnail('https://media.giphy.com/media/CKsIi206Ntz4k/giphy.gif')
.setColor('#FF0000')
.setFooter("Command hosted for Pokehub`s community!");
message.author.send("<@" + message.author.id + ">")
message.author.send({embed});
}
}
});
bot.on('ready', () => {
console.log('Bot started.');
});
How can I add spotify uri as .setImage
it happend after i set tghe location current skytext as description
You never define location, but use it in multiple places
Where did you define it? Maybe it's out of scope
yes
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
at Client.<anonymous> (c:\Users\bilal\Desktop\fitlering\osom_bot (1).js:185:71)
line 185
.setDescription("Weather type:" *${location.current.skytext}*)
i was right
The only place "location" is defined locations.map(location => get_weather({search: location, degreeType: 'C'}))
That's the only place you define location, and it's a function parameter
that doesn't change anything
but it worked
this
fucked it up ${location.current.skytext}
i've put this into the description
instead of the addfields
that's when it stopped working.
Is this a bot farm?
** BOT-TO-USER IMBALANCE ** Admins (74) Total Users: 99 Bots to Users ratio: 89.90 % Real Users: 10 Bots: 89```
@faint prism did you loop through the member count? I'm sus of a server that i think is a bot farm and I wanna leave it kekw
instead of putting it somehwere, with PILLOW can i instead replace a color with a bar?
like with a progress bar
can i replace a color with it?
@drifting wedge what
like i have a rectangle
that is basicly a progress bar with xp
and i have a background
can i put it there like replacing the color?
@faint prism did you loop through the member count? I'm sus of a server that i think is a bot farm and I wanna leave it kekw
@thick gull Yeah I did
is it .forEach() i cannot remember and im too lazy to tryitandsee
for JS
yes
yes
ok
@drifting wedge ok, I dont know what you are talking about. What do you want to replace? YOur color with what?
so i have a card
right
and im writing on top of the card
and i have a rectangle
TypeError: client.guilds.cache.get(...).members.forEach is not a function
where is your rectangle

1 sec
escrever.rectangle((0, 257, (int(cur_xp/xpneed*100)) * 2, 282), fill=(255, 255, 255, 255))
it works
but i want it to write a specific place
like ik i can edit the pixels
well i could its jsut that i want to figure out a way to put it on top of a specific color
I guess you have two bars and one has a color and you want to put it where the color is? Is that what you try to do?
yes
so i want to put my bar over it
ok, but you just edit the pixels
no memes
that is how you are doing that
i can
I dont know why you would make it differently
ah
now I understand
how about you make a second background
that cuts the gray xp bar
and then you put the redbar behind the second background
like the progress bar
that is how people do it usually
can u explain it again?
@mint thicket ^^ meeems
make a background that is transparent at the xp bar
this is your top layer
under it
make a red bar
under the red bar
the grey bar
yes, you can do it how you want to, but I think you get my solution
it is the most simple one
why isnt guild.members.forEach() working for me, it says it's not a function. i've looked it up and asked @faint prism it should work ;tm;
try map()
Not a JS dev, sorry
mk, i got it
What library and what version of it are you using
Are we doing this with canvas? or is it api
https://media.discordapp.net/attachments/699267550223138816/753342475212423319/file.png?width=1022&height=325
with canvas and api? You need an api to get the information and the canvas to display it
that is just the spotify info in the member activity though
Ping
How can I paint the canvas background according to the song background?
colour theif gives you palettes of images and also the dominant colour
@earnest phoenix memes in #memes-and-media next time please.
Is botghost a safe website to make bot commands on?
no
?
please dont
BotGhost is a third-party hosting service
Oki, I can’t figure out how to add commands on the discord website though-
You don't get access to the backend whatsoever so you can only assume it's (un)safe
@half shell you need to code the bot
botghost is going to leak your token everywhere at some point
and your bot will be hacked and you will probably be hit hard by it
so 
your choice
Ight
look up discord js guide
the most simple guide to build a bot
I think it is more simple than botghost
@earnest phoenix can u go shitpost elsewhere?
@earnest phoenix its this dude again
@gleaming glen
ugh just ban this idiot please
STOTP!
@earnest phoenix First and last warning, move to #memes-and-media with the out of context pictures
get out please
that's not how you spell "ban me"
no
Leave it y'all
dont feed the troll
anyways, what were we discussing
anyways, what were we discussing
@misty sigil botghost is like a siren: it lets you taste the sweetness of bot development before wrecking everything you've made
Ah, so just like some bad cake
Honestly, js guide is so imple. Everyone could do a bot with it
tastes good at first
the cake is a lie
Just do it with that xd
1 sec
like i have 2 backhrounds
but i need to save it
how can i save both backgrounds as one
you layer them and at the end, you save it only once, so you create the attachment
You dont save them both. you only create one attachment
yea
can you show the code?
i have save them both as one
1 sec
fundo = Image.open('rankcard12.png')
fonte = ImageFont.truetype('PTSans-Regular.ttf', 37)
font = ImageFont.truetype('PTSansCaption-Bold.ttf', 37)
fontee = ImageFont.truetype('PTSansCaption-Bold.ttf', 45)
xpdiv = (int(cur_xp/xpneed))
pbarwidth = xpdiv * 624
#fonte = ImageFont.truetype('Roboto-Regular.ttf', 150)
#levelfont = ImageFont.truetype('KumbhSans-Regular.ttf', 150)
draw = ImageDraw.Draw(fundob4)
escrever = ImageDraw.Draw(fundo)
#draw.rectangle((1, 1, 1, 1), fill=(64, 64, 255,255))
draw.rectangle((311, 200, (int(cur_xp/xpneed*100)) * 2, 200), fill=(255, 255, 255, 255))
escrever.text(xy=((855, 45)), text=f"{lvl_start}", fill=(154, 156, 159), font=font)
escrever.text(xy=((571, 125)), text=f"{cur_xp}", fill=(154, 156, 159), font=font)
escrever.text(xy=((280, 115)), text=f"{ctx.author.name}", fill=(154, 156, 159), font=fontee)
escrever.text(xy=((700, 125)), text=f"{int((5 * (lvl_start ** 4 / 5)))}", fill=(154, 156, 159), font=font)
fundo.paste(avatar, (86, 66), avatar)
fundo.save('rank1.png')
#fundo.show('levelup1.png')
await ctx.channel.send(file=discord.File('rank1.png'))```
i need to save both "fundo" and "fundob4"
as one
and then send it
this is how I draw avatar, I dont know what .paste and stuff like that mean.
const avatar = await Canvas.loadImage(userz.displayAvatarURL({ format: 'jpg' }));
ctx.drawImage(avatar, 10, 10, 150, 150);
well its python
yes
it seems like they use a different system. Js is a lot easier
and then save them both as one
you need somone who is experienced with python. I am only doing js
x.save('rank1.png') and then do x = fundo,fundob4
Do I download Node.js? That’s what the guide says to do
Yes
Ight
@drifting wedge you need to convert the iamge thing to a bytes object to send it to discord
@drifting wedge you need to convert the iamge thing to a bytes object to send it to discord
@placid iron how?
discord doesnt know about PILLOW images. let me show you how
ok
@half shell yes
ok
so you save it to an ioBytes variable thing
14.10.0
and then you can use that as the image in your attachment
Oki
It took me into ibispaint when I tried to open it
replace the save and send lines with what i sent
ah, BR
you want to send fundob4 as well as fundo?
i want to send them both as one
as one message?
oh so you want to combine the images then send the new image
yea
ooo 1 sec lmao
then you use the ioBytes to send the resulting image
yea
the one at the end is the "mask", just change that to what you want to paste too
so i think
fundob4.paste(fundo, (posx, posy), fundo) no you cant remove it i think
no
yes
and now i gotta byte save?
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: bytearray index out of range
i got this
what is the code you wrote
1 sec
fundob4 = Image.open('progress.png')
fundo = Image.open('rankcard12.png')
fonte = ImageFont.truetype('PTSans-Regular.ttf', 37)
font = ImageFont.truetype('PTSansCaption-Bold.ttf', 37)
fontee = ImageFont.truetype('PTSansCaption-Bold.ttf', 45)
xpdiv = (int(cur_xp/xpneed))
pbarwidth = xpdiv * 624
#fonte = ImageFont.truetype('Roboto-Regular.ttf', 150)
#levelfont = ImageFont.truetype('KumbhSans-Regular.ttf', 150)
draw = ImageDraw.Draw(fundob4)
escrever = ImageDraw.Draw(fundo)
#draw.rectangle((1, 1, 1, 1), fill=(64, 64, 255,255))
draw.rectangle((311, 200, (int(cur_xp/xpneed*100)) * 2, 200), fill=(255, 255, 255, 255))
escrever.text(xy=((855, 45)), text=f"{lvl_start}", fill=(154, 156, 159), font=font)
escrever.text(xy=((571, 125)), text=f"{cur_xp}", fill=(154, 156, 159), font=font)
escrever.text(xy=((280, 115)), text=f"{ctx.author.name}", fill=(154, 156, 159), font=fontee)
escrever.text(xy=((700, 125)), text=f"{int((5 * (lvl_start ** 4 / 5)))}", fill=(154, 156, 159), font=font)
fundo.paste(avatar, (86, 66), avatar)
fundob4.paste(fundo, (311, 200), fundo)
with io.BytesIO() as output:
fundob4.save(output, format="PNG")
output.seek(0)
await ctx.send(file=discord.File(fp = output, filename = "rank1.png"))```
draw.rectangle((311, 200, (int(cur_xp/xpneed*100)) * 2, 200), fill=(255, 255, 255, 255))
this is the line with the erorr
import datetime
import random
#import aiohttp
#import requests
import pymongo
from io import BytesIO
from pymongo import MongoClient
from PIL import Image, ImageDraw, ImageFont, ImageOps
from discord.ext import commands
from discord.ext.commands import command, cooldown, BucketType, Cog```
these are my imports
from io import BytesIO
with io.BytesIO .....
do you see a problem?
const arkaplan = await Canvas.loadImage('https://media.discordapp.net/attachments/699267550223138816/745787010073231390/arkaplan.png');
^^^^^
SyntaxError: await is only valid in async function
make your function async
you have to iirc
-p music
const browser = await puppeteer.launch({
defaultViewport: {width: 1920, height: 1080}});
const page = await browser.newPage()
await page.goto('https://sa-mp.im/server/war-stats/22/cuneo-vs-triads')
const element1 = await page.$eval('#nav_righter > div > div > div > div.center > div > div:nth-child(1) > h3', el => el.textContent);
const element2 = await page.$eval('#nav_righter > div > div > div > div.center > div > div:nth-child(3) > h3', el => el.textContent);
var amountString = element1;
var amount = amountString.replace(/\./g, '').match(/^.*([0-9]{10})/)[1]
var amountString2 = element2;
var amount2 = amountString2.replace(/\./g, '').match(/^.*([0-9]{9})/)[1]
var x = amount - amount2;
const element3 = await page.$eval('#nav_righter > div > div > div > div.center > div > div:nth-child(3) > h3', el => el.textContent);
var amountString = element3;
var z = amountString.match(/^.*([0-9\.]{10})/)[1]
await browser.close()
return {diff: x, triadlost: z};
};```
why isnt it returning diff , triadlost
ehhhh....
Hello. I am trying to fetch invites and cache them for all my servers. and everything works. but I get errors for the guilds that do not allow my bot to fetch invites. I need to figure out how to fetch invites ONLY for guilds that allow him those permissions or atleast hide the errors. can anyone help me?
How do I get the total amount of users in all the servers my bot is invited to?
Hello. I am trying to fetch invites and cache them for all my servers. and everything works. but I get errors for the guilds that do not allow my bot to fetch invites. I need to figure out how to fetch invites ONLY for guilds that allow him those permissions or atleast hide the errors. can anyone help me?
@sweet ruin try catch
and catch permission error
create a custom error event handler
what's the fired error ?
it sends about 20 of these
making it seem like 20 servers dont allow him perms to do that
no
like i said
all of it works
i just doing it for myself
so that I dont see errors
haha
why dont u just check if the bot has permissions for that guild
yes but i am unsure of where to put that
and errors arent just wanted to be removed for visual ur sending discord rest errors to the http api of discord
i know the code is like guild.me.hasPermission("AUDIT_LOGS")
yes
well just put it before the guild invites thing
it return booleam
if(!guild.me.hasPermission("AUDIT_LOGS")) return ;```
something like it
g.me.hasPermissions("AUDIT_LOGS") ? return: continue```
what error?
?
before return
wont return
return null then
is it possible to make bot message the top avaiable channel without having an ID of it?
is it possible to make bot message the top avaiable channel without having an ID of it?
@ancient nova what ?
how?
i've it
the id is always needed because of the http requests u have to make
alright
var chx = guild.channels.cache.filter(chx => chx.type === "text").find(x => x.position === 0);
that returns the objects of the channels so that will work
it will get the first text channel
chx.message.send('your message') am I right?
how i can do that: https://i.imgur.com/a0tcGII.png
chx.message.send('your message') am I right?
@ancient nova yes
but with my bot
alright thanks a bunch @hexed vortex
@sweet ruin what does the vsc error say
alright thanks a bunch @hexed vortex
@ancient nova you're welcome
hmmmm hmmm hmmm weirdddd
anyone here better than me at js here lmao
cause idk on that one
how i can do that?
😔
deafen?
I'm trying to get the current position of an element but idk how lmao
Object.keys(donations).sort((a, b)=> b - a).map(x => `${x.indexOf(donations[x])} • **${client.users.cache.get(x)}:** ${nFormatter(donations[x])}`).join("\n")
the ${x.indexOf(donations[x])} just returns as -1
donations.json
{
"131841679769600000": 5000000,
"481000248034983936": 50100000
}
@sweet ruin, yes
@earnest phoenix pro tip dont use json or config files for storing data
it's temporary
I understand that
Just need help for now
hmmm then lets see
@earnest phoenix what have you tried
<ClientUser>.setDeaf(true)
😔
please stop making up your own methods and properties
refer to the docs
ok
thx
@hexed vortex cannot read property of send?
@earnest phoenix .indexOf returns the index of a certain phrase found in a string. So what you're trying to do is find the value of donations.json in the key of it.
lol I figured it out
aight
thanks anyways ❤️
https://discord.js.org/#/docs/main/stable/class/VoiceConnection?scrollTo=voice
https://discord.js.org/#/docs/main/stable/class/VoiceState?scrollTo=setSelfDeaf
im on mobile so im a bit late @earnest phoenix
ofc
Is that json db?
huh?
What is invites
Well it looks like there's nothing cached
and again it worked before without the line 36
Which was?
ill show you if I comment it out
i wont get errors
Well
ill get errors for guilds that choose not to allow permissions to view invites for my bot
but i wont get the id error
euh sure
it logs about 120 guild id's
if that makes sense
i cannot send ss because confidentiallity
guildCreate event how do I make it message the top channel of the server?
euhhh
i make it search for channels
but if there is a .position
like channel.position
@ancient nova top channel or the system channel?
bot.on("guildCreate", guild => {
if (guild.memberCount < 5) {
var chx = guild.channels.cache.filter(chx => chx.type === "text").find(x => x.position === 0);
chx.message.send('Your server has been tagged as a fake/dummy server, therefore the bot will leave, to prevent bot from leaving next time, please make sure to have atleast 10 active members and that you have not exeeded the amount of avaiable servers')
guild.leave()
}
})
guild.channels.position(0) would do it
Yeah I'd send that to the systemChannel
so I'm wondering why doesn't it work?
from io import BytesIO
with io.BytesIO .....do you see a problem?
@placid iron the problem is?
Basically
you are importing bytesIO but trying to use io
so?
is it possible to make it then
I've seen bots have it
but I can't seem to make it
Why the top channel?
That's probably going to be "rules and info" or something like that
top channel because that's auto leave command
bot.on("guildCreate", guild => {
if (guild.memberCount < 5) {
var chx = guild.channels.cache.filter(chx => chx.type === "text").find(x => x.position === 0);
chx.message.send('Your server has been tagged as a fake/dummy server, therefore the bot will leave, to prevent bot from leaving next time, please make sure to have atleast 10 active members and that you have not exeeded the amount of avaiable servers')
guild.leave()
}
})
read the code of it
I'm really confused
Why don't you want to use the systemChannel
don't know how
guild.systemChannel.send("message")
what if the guild doesn't have a system channel
Then auto leave and DM the owner of the server or something
you are importing bytesIO but trying to use io
@placid iron so wut improt?
import?
oh, that'd be better
And if you can't do that then just leave
how do I do that?
Firstly, read the docs
just import io
Then how did you find the time to make a bot
No
But I'm not going to write it for you unless you pay >:)
the bot I've been developing for past 7-9 months
Longer than me
come on man I'm not gonna pay for like 2 lines of code
Bruj
if you cant be bothered to code ur own bot dont code at all
^
I do code it, the problem was that I didn't know some of the code that was needed to something I was writing
what else am I supposed to do if not ask for help?
learn a bit of basic javascript?
I do know javascript
I am saying that I don't know everything about discordjs
I am good with javascript
by itself
yes, I do, I think I got it so I gotta go I had some stuff to finish after that
follow that guide to understand discord.js basics
also I know that I lack some knowledge about discordjs but I'll learn it eventually
lol
@tight plinth I'll look at it later, thanks
gl coding then
thanks
can i again ask how to await a map sort of
things.map(thing => {
const newThing = await getThing(thing)
return newThing
})
always returns [object Promise]
Promise.all?
Hey I need some Help with MongoDB, what do I put for the username and Password? I don't understand it much
@raven urchin for username you put your username and for your password you your your password
tony
Have you created a cluster and stuff?
I have created a cluster yes, but idk where to check my password and username
weird
i see that actually what its saying is its returning an object of promises
so whatever newThing is, it's a promise that hasnt been resolved
same erorr
well for starters
you should still add async because if you have await inside a non-async anonymous function its basically like invalid
yeah
but otherwise to sort that should work
hmm
does running async getThing() return something other than a promise
outside of that code
no it always returns a promise
Hello
const getValue = (val) => {
return new Promise(async (resolve, reject) => {
// ...
});
}
real func
interesting
@sharp thicket how can I assist
Do anyone here know what are heroku events? That dude is trying to setup a webserver on heroku and it's asking for that
yeah
Thefuck
I am confusion
oh thats right
KuuuUUuUUuUuuuUuUuuuUUU, but whyyYYy?
Afaik you're just supposed to import ur code, setup the dyno and run the code
I'm trying to make a webhook that works with dbl in heroku
@sick cloud you cant return an entire promise like that, but if you do you still have to resolve it to actually extract the value
er
i mean you can return promises
but like
awaiting it doesnt automatically resolve it
what youre saying is basically, "when this function returns, i will return an unresolved promise"
I'm confused..
i can send the full code if you want
wait
@sharp thicket please send screenshots or record how exactly you're setting up heroku
i got it
k 1 sec
did you use promise.all
Something is not right there
yes
nice
and await getValue(message.guild.config[key]); in the map()
oh ic
so ye
well congrats
i go to view webhooks
promise.all is really good for lots of promises in parallel
make one
how can i layer 2 images on top of eachother with PILLOW?
gotta love js
noone help me ;c
?
?
That's not how you're supposed to create webhooks
How do i make one?
You see, those are basically subscriptions to events (eg. receive a message when it goes off, or when the code is updated)
What you need to do is create a new repo (workspace? Idk how it's called there)
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: bytearray index out of range
wut does this mean?
What you need to do is create a new repo (workspace? Idk how it's called there)
@lyric mountain ok done now?
?
u there?
anyone?!
You need to setup a code that will run on heroku
It's just like any other software
Do you have a bot?
yep
Same thing
Except instead of a bot it'll be a webserver
Research a bit about express.js
what do i add there though?
It's one of the easiest to setup imho
ok]
im pogger
Yes, PIL is blocking @drifting wedge
@sharp thicket Also, please don't use Heroku like this other guy suggested, you can save so many headaches by getting a VPS
Need to run your bot 24/7? Get a cheap VPS.
https://www.scaleway.com/ EU https://www.linode.com/ US/EU/Asia
https://www.digitalocean.com/ US https://www.vultr.com/ US
https://www.ovh.co.uk/ EU/Canada https://galaxygate.net/ US
https://www.time4vps.eu/ Lithuania. https://www.hetzner.com/ Germany
Self-hosting: Free hosting: Kinda free:
Any computer. No. Not even heroku. GCP, AWS have one year free micros.
"the other guy" didn't suggest, it's he who said he'd use heroku
and please, either kuuhaku or sora
can you recommend a vps?
contabo
cc blocked oof
GalaxyGate accepts PayPal, debit, & credit cards, and they are fairly decent
whats the difference?
isn't galaxy gate expensive af?
Whatever you do, stay away from OVH, lots will claim they've had zero issue with them, but the ones that do.. Talk about a fucking nightmare
No, they are extremely cheap
isn't galaxy gate expensive af?
@lyric mountain no
whats the difference?
@sharp thicket
so if i were to use a vps how would i make the webhook?
a vps is basically a remote computer
you just need to run the webserver just like you'd do in your pc
not localhost because you'd have the vps' IP
oh so host it in the ip
webhooks are like APIs: you send a request and it'll process it
?
const http = require("http");
const { ESRCH } = require("constants");
const host = 'IP';
const port = 8000;
const requestListener = function (req, res) {
res.writeHead(200);
res.end("WebHook!");
};
const server = http.createServer(requestListener);
server.listen(port, host, () => {
console.log(`Server is running on http://${host}:${port}`);
});
like that?
except that code would be running in the VPS itself
How can I get a Spotify oauth token unlimitedly?
so dblapi can access it
the url would be the IP + the port + the endpoint (if there's any)
@earnest phoenix wrong server
for example: 127.0.0.1:1234/someapi
IP:PORT/path
Google is best at this point, he knows far too little to try & direct him (not trying to be rude)
i don't have path so
yep, it's IP:PORT then






