#development
1 messages · Page 1267 of 1
this case for regex i find good
@opal plank was the pic for me?
But what can indexOf("<@") return in, say, lalala <@ ululu?
wuts regex
and should i use it in a botum
the numeric index it is placed at in the string
yes
in the above case: 7
index of which cha- yeah makes sense now
the index
add a ?
are free trials ok for temporary issues because heroku has Error waiting for network: Resource temporarily unavailable
are free trials ok for temporary issues because heroku has
Error waiting for network: Resource temporarily unavailable
@white vapor what free trial?
for hosting
just host yourself
im still running node 12 in prod
OOOF
waiting for 14 to become lts
i think mine is at 14.6
i also need to update my ubuntu from 18 to 20
@faint prism is there a specific user agent you recommend for mobile? Basically need to grab the html as fast as i can
@faint prism is there a specific user agent you recommend for mobile? Basically need to grab the html as fast as i can
@rancid sand https://deviceatlas.com/blog/mobile-browser-user-agent-strings
An extra header won't slow it down
is it responsive?
It's relative 
That's the hard part
@autumn aspen wait oh
@shy turret in what command
show an example
bc it wrong
if (message.mentions.users.first()).id; return msg.channel.send(":x: **Sorry drat!** :x:");```
bad ^^
oh
What is the use of a eval command
that's some wow syntax
either conditional chaining or check if mentions exist
yes but show an example how I should put it
@autumn aspen https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
read the docs
¯_(ツ)_/¯
@hazy sparrow for if you ever want to run code through discord
eh
So im using a json file to save my server prefixes but when i restart the bot it dosent register the prefixes. And just uses the default prefix. If you do the commamd to change the prefix again it just puts another store in like the first one isint even there
So i can make new commands in discord itself?
bad idea to have your prefixes in json @dense nest
What should I use @opal plank
you don't use your eval command to develop
Bad idea to use json as a database @dense nest
How in tf would i use a database
eval helps a lot for debugging
you don't use your eval command to develop
@sonic lodge no i mean could i?
as in make an entire command through your bot's eval command lol
cuz u can access initialized code
yes you could make a command
like !eval <command code here>
can you can branch off from the index to your other files
you basically have the debugger to check the code as it runs and the eval to fetch values and data from stuff your debugger isnt attached to
i highly recommend eval for production
How in tf would i use a database
@dense nest A similar way you are using JSON
Kk
why do you want to make commands through discord though
@faint prism help? Lol.
when you have a nice code editor with syntax highlighting and all that good stuff
@faint prism help? Lol.
@dense nest just look into quick.db or something
just don't use json for mutable data
eval isnt for making code @sonic lodge
its a good tool for debugging
and testing
thats about it
it's what bow pro is asking for

So i can make new commands in discord itself?
my reaction ^
i guess you could even fancy it up even more and fsWrite() new files with your code in it
¯_(ツ)_/¯
and then require it
that's massive brain
i already have dynamic requires
adding new commands to production easy
put file in
type n.reload
done, everything else is handled internally
the cache is deleted and the metrics are reloaded too
not quite
like i said, i just need to put the file there
i use git to do that
even with the production server on
no need to shutdown to add commands
neither for my global handlers nor for the commands
i havent added dynamic gauges nor functions though
YET
im so proud of my handler tbh
All errors are dumped in here
So console spam whatsoever
simply check the dashboard now to check if i had any error throughout the code

anyone know how to add header when requesting from an api with node-superfetch?
if you don't mind i'll steal your idea
do you accept brains
🍝 🍺

wait that's not my brain
Thats not even the tip of the iceberg of good ideas i implemented in the bots tbh
ok so now i need your brain
const request = require('node-superfetch')
const { body } = await request
.get('https://abstractlist.com/bots/701510083133309039/stats').set({"Authorization": config.abstractListToken })
console.log(body)
it just says 404 Not Found
idk if thats how i add headers
how do you make a new line in node.js
\n
k
I have a question
i do
i installed SQL workbench
but thats the gist
how do i use it?
Why won't my bot start? No error at all, just the logs from handlers
Listen to the debug event
@opal plank do u know SQL?
@modest smelt google does
Then you either cant use google or it doesnt exist
i would say the first one
reading the docs and adding a library to bridge over the database and your code
depending on what you're doing, i'd go for postgres
rather than SQL
i just want a database
MySQL workbench is a client not a server, you still would need to install an actual database server to use mysql.
so what should i do?
I would strongly advise against MySQL specifically because it's shit to install and run
im looking at w3 schools
If you just need a database, I'd just suggest using SQLite, since it's actually server-less and easy-ish to install
alr
it's "just a file" (made the right way, as a true database, just not a server/client architecture)
ill look at it l8er
And if you really want to make your life super easy, assuming you're in nodejs, check out https://enmap.evie.dev/ (disclaimer: I made this)
nice
mysql can be really powerful if you set it up just right 
but you should use mariadb over mysql as much as possible
how should i set it up?
kk
await bot.edit_message(embed=embed2)```
Instance of 'Bot' has no 'edit_message' member
why is it saying this?
there is no function edit_message available on bot
seems like you should be using message.edit instead
that py i think
ye i looked up discord.py's docs
looking for a bot developer to help me code a Anti Raid bot
@split hazel
-needdev @sinful thistle
@sinful thistle
DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.
how do you use ` inside your `` string
You escape it with \
okay
it sends the message twice for no apparent reason
Yo wtf are u doing
Oh i thought that was html
@honest perch also id use ejs for simpler things
how do you stop running your bot after doing node .
cntrl c
k
client = commands.Bot(command_prefix = commands.when_mentioned_or(f'{prefix}'))
how can i make the prefix on mention or with a var?
Guys if u wanna mark and move all the commands to right how u do? ctlr -> or what?
pls help
huh?


look
erwin you ok?

add spaces
client = commands.Bot(command_prefix = commands.when_mentioned_or(f'{prefix}'))
how can i make the prefix on mention or with a var?
ping me plez
middle mouse drag in the beggining
how
so like mention works as a prefic
wdym prefix on mention
@slender thistle me?
me
@autumn aspen
middle mouse
though you should use a linter
whatever the fuck you doing in your code is just making it a mess
no lol
yes
mention
this is messy'fying your code
Stop using useless f string smh
this is messy'fying your code
@opal plank dont care abtwhat I do haha just what u mean drag just show me a mouse cam and jey
keyboard
oh thx

"When mentioned or some other prefix"
@slender thistle so the prefix is the bot mention or a var
Did you read the docs on what when_mentioned_or does
yea
:NGNLKaeriThumbsUp:
@opal plank I tried and it didnt work?
i literally showed it working
Did you really
What did they say
it said that i can use when_mentiobed as a event or as a prefix thingy
in this line: message.channel.send(${statuses.statuses.text})
using when_mentioned as an event? 
it isn't
w
Did I miss out on a new random update or what
You simply didn't
@opal plank but dude what u mean drag with what button on mouse bc its only delete the code
huh
statuses returns an array
which doesnt have property text in it
get one of that status you want
from that array, THEN get .text
@opal plank not erwin show cam mouse and keyboard
i told you, hold middle mouse button
could you provide me a site on how to get it as .text
what?
i told you, hold middle mouse button
@opal plank middle mouse that Im scrolling with
or what
you dont get an array as a .text
the docs for this
you pick an entry inside the array
@autumn aspen hold it
click it and hold
and then
drag it around
yes but what
just add spaces manually then
just add spaces manually then
@opal plank I marked it and now?
so do I press anything
you telling me you dont know how to add spaces in your code?
or hold

:NotLikeMiya:
@opal plank I do
then do it
but ur way
press space bar
'my way' aparently is too complicated for you
just do it the old way
and add spaces on each line
but man what u mean middle button
i told you how
middle click and hold it, then just drag it around
I think im happy with the final result

whats that?

are you not using a lib that doesnt aht already?
without lags eh. there is only so much you can do with that
but i mean just do some simple forEach thing
client.users should already have cache
bad
forEach prob some of the least performant loops
use for()
Hello all. I am trying to code a command that allows server managers to set roles that are awarded when a member reaches or is above a certain level. I have made the command part of it. but i dont know how to make it so server managers can add multiple role rewards for multiple levels in one command. how do I do this?
database
| threshhold | role id | server id |
query by server id, select all
then check if the threshhold has been passed
if so, award user
i'd highly recommend NOT doing this on every iteration of message
if you start needed it on a bigger degree, have it stored in memory
use redis or store it yourself
so currently i have this
i dont know mongo, im telling you the framework you should use
ah thanks
Im familiar with the syntax for types and PostgreSQL though
should you not be using primitive types?

huh?
Aren't those privative?
(sorry legit databases gimme headache even when I understand them)
MongoDB has it's own datatype names
Those are all primitive
That's TS, are they using typescript
im using js
In regular JS there is no number
dont think so from the looks of it
coulda sworn mongodb has number..
I mean, objects are fine too
an object is an instance of a class
auger
class is the template for some data structure/functions
object is an instance of that class with values
they go hand in hand
class Person // the class ie. "blueprint"
{
string Name;
}
var newPerson = new Person() { Name = "Jeff" }; // an object
newPerson.Name == "Jeff"; // this is true
How do I know how many of the same string are in the json file?
test.json.length?
How do I know how many of the same string are in the json file?
test.json.length?
@earnest phoenix no. Length is the amount of characters iirc
For finding the same string you'll need to do some comparisons
porbably easiest way to explain objects is with examples
its too simple
usually you learn classes down the line
so using it as a comparator is quite hard to grasp
@faint prism
you can do functions directly too
console.log({im_a_property: 'a',im_another_function() {console.log('function')}, im_a_proprity_with_object: {hi:'hi', foo: 'hello'}, im_an_array: ['hi', 'bar'], im_a_function: () => {console.log('honey')}})```
how do i add a - before the random number
message.channel.send(Math.floor(Math.random() * 1000000000000000000 + 1))
break;```
this is only for bots right?
if this is only for bots
'this' what?
technically yeah but programming related is fine too
not support for specific bots though
for that you need to dm the author of the bot
im gonna flip if i see another 'InviteManager is offline, what do i do?'
ohhh ok
message.channel.send('-', Math.floor(Math.random() * 1000000000000000000 + 1))
break;```
oh sorry
ohhh
i thought am in testing
ok now its working

I have a config.json I put my command and token there and I tried to make a ban.js and I put require config.json from there and it didnt work?
Like a put both require things in ban.js
And still dont a command handler?
Why
Someone?
Bc I put token and prefix in config.json
And from there I want the command handler
So anyone help, shold I npm i something or what?
am i able to transfer this code
message.channel.send('-' + Math.floor(Math.random() * 1000000000000000000 + 1))
to an embed
or do i have to heavily modify it
https://nodejs.org/en/knowledge/getting-started/what-is-require/
https://discordjs.guide/command-handling/
@opal plank thx
@long lantern BR => #general-int
Hi, does someone can help me with my bot? I'm trying to access a variable from an event. The variable is created when executing a command.
The bot is in Node.js and Discord.js
Thanks ^^
@drifting wadi what variable? Can you show us your source code so we can have a good idea of what the scope is
if(command == 'autocanaldevoz') {
let activado = 1
async function createChannel() {
const idcanal = await message.guild.channels.create ('Sala Privada', {
type: 'voice',
permissionOverwrites: [
{
id: message.guild.id,
allow: ['VIEW_CHANNEL'],
}]
})
return idcanal
}
createChannel()
}
client.on('voiceStateUpdate', (oldMember, newMember) => {
let newUserChannel = newMember.voiceChannel
let oldUserChannel = oldMember.voiceChannel
if(newMember.voiceChannelID == idcanal.id){
if(activado == 1){
if(oldUserChannel === undefined && newUserChannel !== undefined) {
async function createChannel() {
const nuevocanal = await message.guild.channels.create (`Sala de ${newUserChannel}`, {
type: 'voice',
permissionOverwrites: [
{
id: message.guild.id,
allow: ['VIEW_CHANNEL'],
}]
})
return idcanal
}
createChannel()
}
} else if(newUserChannel === undefined){
// User leaves a voice channel
}}
})
Here it is
How do I count how many trues are in a json file?
[
{
test: true
},
{
test: true
},
{
test: false
}
]
return: 2
@earnest phoenix reserialize it and increment an integer for each array item that has test as a positive boolean
Not too difficult
Someone makeing bot with bot designer for discord?
Someone makeing bot with bot designer for discord?
@fathom tangle No lmao
what?
@fathom tangle No lmao
@faint prism ok lol
client = commands.Bot(command_prefix=commands.when_mentioned_or(f'{prefix}'))
does this work?
no errors
but the prefix var doesnt work
is the _or valid?
Is it possible to change the online status of the bot without a WSS stream to the gateway?
Imma using simple cURL requests time by time to scan channel messages.
I would like show the bot as online in the member list.
is there any way to transfer glitch code to a raspberry pi?
do you mean Glitch website?
hahahahaaha
the legends are true it seems
is there any way to transfer glitch code to a raspberry pi?
@stray sinew yes, there is a way to transfer your javascript project to a raspberry pi
But someone else might be more familiar than I am
git clone i assume
is it heroku or glitch that uses repos?
either way, just make a repo for it. Worst case scenario, just copy everything from the website manually and save file by file
oh wow ty
its a discord.js
is that allowed?
there isnt any youtube video
oh wow ty
heroku uses repos
Sometimes i wonder what goes thru people's minds to do this ^^
Is it possible to change the bot presence with an API request for example via. cURL?
you need a wss connection i'd assume
Permanently or just once a time like the gateway registration?
you mean status?
rich presence isnt available for bots @boreal iron
if you mean DnD, online, invisible, those can be changed after gateway
Yeah just the online status.
Imma simply curling the API time by time with PHP. I don’t need a permanent connection.
But the fact the bot is “offline” is annonying
No library
lemme see if i can find the doc for that rq
Ty
Check discord developer docs
To remove the bot’s offline status it needs to have a heartbeat
So u need a ws connection
Thought I could easily POST the status to the API for example POST /api/v6/users/@me
Nope
Ah ok
Sad for me
Is there a timeout between the heartbeats?
Gonna think about to create a simple JS wss connection just sending heartbeats each second/minute?!
how can i make this work
client = commands.Bot(command_prefix=commands.when_mentioned_or(f'{prefix}'))
Py?
bot.on('message', message => {
if (message.content === '/help') {
const embed = new MessageEmbed()
.setTitle('General Commands')
.setColor(0xff0000)
.setDescription('myavatar');
message.channel.send(embed);
}
});
``` why is thhis wrong?
@slender thistle
What's wrong with it? Didn't you write it
imagine pinging someone who works with Python
What's wrong with it? Didn't you write it
@sudden geyser yes

lmao
So what is wrong with it
idk it gived me a err
pk
C:\Users\admin\reportbot\index.js:62
const embed = new MessageEmbed()
^
ReferenceError: MessageEmbed is not defined
at Client.<anonymous> (C:\Users\admin\reportbot\index.js:62:23)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\admin\reportbot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\admin\reportbot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\admin\reportbot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\admin\reportbot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\admin\reportbot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\admin\reportbot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\admin\reportbot\node_modules\ws\lib\websocket.js:797:20)```
thats error
I got
@opal plank

Discord.MessageEmbed()
oh ok
or import MessageEmbed directly
{ MessageEmbed }
usually you'd only use Client and MessageEmbed
might be worthwhile loading those 2
if it gets bigger than 3 i usually just require the whole thing
also also
can any1 pls help!
client = commands.Bot(command_prefix=commands.when_mentioned_or(f'{prefix}'))
does this work?
no errors
but the prefix var doesnt work
is the _or valid?
d.py
Discord.MessageEmbed()
@white vapor wrong
that worked for me so
const embed = new Discord.MessageEmbed()
.setColor(0xFF9EC2)
.setThumbnail(message.author.displayAvatarURL())
.addField('You are:', message.author.username)
.addField('Requested in', message.guild.name);
message.channel.send(embed)
break;```
@white vapor you shouldnt try to help without knowing what you on about
its not a 'it works for me'
it depends on his variables
what he's importing
@autumn aspen show me the top of your file
emoji doesnt appear in the server with it
@versed thorn play pornhub intro 1 hour
o_o
that worked for me so
@white vapor you're right. It's within Discord.js. So as long as they require it with Discord as their variable name, that'll work
for all you know they coudl've called Erwin the variable that requires/imports discord
¯_(ツ)_/¯
Tfw function name is $
whats the prefix code for dpy?
I need help
when I use a embed command
like with a embed reply it gives this error
[2020-09-24 21:34:29] [COMMAND] /home/runner/Discord-Bot-List/src/bot/commands/Utility/feature.js
[2020-09-24 21:34:29] TypeError: fields.flat is not a function
[2020-09-24 21:34:29] at Function.normalizeFields (/home/runner/Discord-Bot-List/node_modules/discord.js/src/structures/MessageEmbed.js:443:8)
[2020-09-24 21:34:29] at MessageEmbed.addFields (/home/runner/Discord-Bot-List/node_modules/discord.js/src/structures/MessageEmbed.js:259:42)
[2020-09-24 21:34:29] at module.exports.run (/home/runner/Discord-Bot-List/src/bot/commands/Utility/feature.js:33:3)
[2020-09-24 21:34:29] at process._tickCallback (internal/process/next_tick.js:68:7)
javascript
error
lib?
or well node.js
not javascript
then check if you have a function called fields.flat
I dont
in feature.js
thats in node
of course its in node
is the node modles
/home/runner/Discord-Bot-List/src/bot/commands/Utility/feature.js
where did THIS come from?
oh my bad
yeah thats what i said, update node
Thats the command and it dont have fields.flat
they said they have
the discord.js library has array.flat, and it requires node 12.
hmmm looks like an outdated file
either discord.js or node
try updating both
okay
not the case
Clearly you didn't install node 12, then. or the bot isn't running on that version. 100% that is the problem.
thats same that i assumed
let me try something
question about translation, if i'm going to translate the text in the bot, should i translate command names too, or should i leave those the same?
because stuff can get messy with accents and different types of spelling
I would leave those the same. Tbh having it be one way is easier than having multiple versions of the command name
Np
Yes, the prefix would be <@botid> or <@!botid>
(a good regex where the ! is optional would work fine)
not sure if py regexes are the same
though ry n.tag regex in #commands @drifting wedge
also
i think i messaged something up
this isnt working but no errors
client = commands.Bot(command_prefix = f"{prefix}" or f"@742831363358589028")```
It's <@id> not just @id
also !
yeah but the ! is optional - it will only appear if the bot has a nickname
check the command i said in testing 0exe
if the bot has a nickname it wont trigger
cuz it has a ! in it
he's perfect matching
'!a' =/= 'a'
it's my node version
but I can't update because I'm using repl
you can define the version in the package.json in the "engine" section
wont work
repl.it has to update it globally, across all users
"engines": {
"node": "12.x"
},```
but it won't update
I dunno my repl have definitely been on 12.x when I created new ones so it's something that can be fixed.
how do I enable my bot
depends on the language
English
... the programming language you muffin.
yeah english
it's a troll
This is not a shitposting channel.
If you don't even know what programming language you're using, we're gonna have a lot of fun.
what is the file extension? .txt .py .js .go ?
cpp
Lol
good luck with that
What’s cpp
c++
yeah I honestly have no idea how to run a cpp program
it's a lowlevel language
Then when ppl need support, I’ll ban them for cursing
yeah I honestly have no idea how to run a cpp program
@umbral zealot ur a bot dev
U know how to code
Oh
Wrong person
I'm not a C++ dev and I've literally never run a C++ program or written one or looked up a tutorial.
My bad
c++ is not beginner friendly in the slightest, people have around 4 years of education just to master it lol
im still waiting for my bot to be aproved
class MyClientClass : public SleepyDiscord::DiscordClient {
private:
void onReady() {
SleepyDiscord::Message message = client.sendMessage("#general", "pong");
std::cout << message.content;
}
}
int main() {
MyClientClass client("NzU4ODE4MzUwMDEyMTcwMjQx.X20eqA.skfLg1iabqL9-mRUF-dmqBXAyMM");
}
yeah you're gonna still wait for a while, Freddy. 6+ weeks of waiting
yup
@jade pewter first off, reset your token, because that's your bot's password,
Second, we have no idea how to run C++ code.
If you don't either, maybe you should choose a language that's not so hard to use
ok
yeah you're gonna still wait for a while, Freddy. 6+ weeks of waiting
@umbral zealot ive added my friends server and that gets added as soon as you add the server
what is beginner friendly
javascript and python are
ok I do java script
@jade pewter look up tutorials for discord.js or eris
ok
oh well yeah that too
discord.js is the library i'd recommend you look into after you get your bearings with javascript
it's much easier than C++
ok
python and discord.py are also options but I personally use javascript so I'm more biased towards it
theres lots of discord.js tutorials for when you get there too so I'd just go with that
it's up to you for which language you want
just make sure you actually learn it
before you start
ok thanks
yeah
c++ is not beginner friendly in the slightest, people have around 4 years of education just to master it lol
even master is probably an overstatement
class MyClientClass : public SleepyDiscord::DiscordClient {
private:
void onReady() {
SleepyDiscord::Message message = client.sendMessage("#general", "pong");
std::cout << message.content;
}
}int main() {
MyClientClass client("NzU4ODE4MzUwMDEyMTcwMjQx.X20eqA.skfLg1iabqL9-mRUF-dmqBXAyMM");
}
@jade pewter is nobody going to say TOKEN LEAK
Come on
Better regen your token
guys discord dm me
TypeError: Cannot read property 'on' of undefined
I keep getting this when I define by bot in my index.js
module.exports.bot = new discord.Client(({ partials: ['MESSAGE', 'CHANNEL', 'REACTION'] }));```
Then do
```js
const index = require('./index');
const bot = index.bot
bot.on('messageReactionAdd', async (reaction, user) => {```
How do I fix this?
this is discord.js btw
Hey cool guy,
Safety Jim here! It appears that the token for your bot, cool bot has been posted to the internet. Luckily, our token-scanning gremlins noticed, and have reset your bot’s token - hopefully before anyone could have maliciously used it!
It's in relation to you pasting your bot's token here.
Discord will warn you and reset it for you.
oh ok
You shouldn't give it out publicly because it's like a password.
Wow that's cool
It's been a thing for a while.
Never seen that before
So is it a Discord thing or just a bot here posts Gists with bot tokens
how do u use eval to change the server icon
I'm about as far as I can get within my own mind
how do u use eval to change the server icon
@indigo flax what lib
what options do i have to make pinging the bot a prefix?
commands.when_mentioned_or
literally what you used sometime ago
hey guys i have a question
@client.command()
async def help(ctx, prefix, type_help = "None", page:int = 1):
author = ctx.message.author
if type_help == "None":
embed = discord.Embed(title = "Help Command", value = "Welcome to the Help Command. Look at the various categories the bot has to offer! If there is a <> it is optional! Also if there is a [], that is required. This bot is made by ! bobthefam#6969", color=discord.Colour.blue())
embed.add_field(name = f"``{prefix}polls``", value = "", inline = False)
else:
embed = discord.Embed(title = "Oops", description = "I think you may have misspelled something. Try again")
await ctx.channel.send(author, embed = embed)
```For some reason when I run this, it says that ```Ignoring exception in command help:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 847, in invoke
await self.prepare(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 784, in prepare
await self._parse_arguments(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 690, in _parse_arguments
transformed = await self.transform(ctx, param)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 535, in transform
raise MissingRequiredArgument(param)
discord.ext.commands.errors.MissingRequiredArgument: prefix is a required argument that is missing.```
do you know why?
wdym
as a custom arg
so where should i put it?
it is something the user defines
bc of customizable prefixes
i think i do
Customizable prefixes should be done in a different way where you simply get it from something like a dictionary
That way they would make far more sense
i store them in json
prefixes[str(ctx.guild.id)]= prefix
visual studio code crash when I do command
prefixes[str(ctx.guild.id)]= prefix
Alright
Attach that dictionary to your bot object under some special property
bot.prefixes = prefixes
Or just straight up bot.prefixes[...] = ...
Attach the prefixes dictionary to your bot object
bot.prefixes[...] = ... what would go in there?
so that you could do self/ctx.bot.prefixes[str(ctx.guild.id)] from anywhere (wherever you have access to the bot object)
wdym
Apply the similar logic as your code
Just prepend bot. there
so im saying what is x and y in this case: client.prefixes[x] = y
yes
prefixes[str(ctx.guild.id)]= prefix
Does this make sense to you
so just do client.prefixes[str(ctx.guild.id)] = prefix?
Aye
thanks
And make sure you use client.prefixes everywhere
Correct
ok
visual studio code crash when I do command
how to fix?
You'd then just do prefix = self.client.prefixes.get(str(ctx.guild.id), ""in case custom prefix wasn't found for the server, this will be used instead")
edit the icon data
screams in eris
const Eris = require('eris');
const bot = new Eris(process.env.DISCORD_BOT_TOKEN);
bot.on('ready', () => {
console.log('Ready!');
});
bot.on('messageCreate', (msg) => {
if(msg.content.includes(Scream)) {
bot.createMessage(msg.channel.id, 'AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH');
}
});
bot.connect();
any1 here have nice knowledges of gif-encoder-2 and canvas?
Lol
@slender thistle does this work?
client = commands.Bot(command_prefix = commands.when_mentioned_or prefix)
it just no errors
but the actual prefix var doesnt work
Well I found out that this is blocking my command from running
context.Guild.DownloadUsersAsync().Wait();
Tbh, I probably shouldn't have that inside the cmd...
How can I check if my cache for the users in a guild is outdated?
hmm maybe this
if (!context.Guild.IsSynced)
context.Guild.DownloadUsersAsync().Wait();
why not use DiscordSocketConfig.AlwaysDownloadUsers?
How can I check if the author of a message has the highest role in a server?
get server role list.
get highest.
get member highest.
compare.
profit??
@upper elm
alr, thanks here's a cookie (>^-^)>🍪
js is fun sometimes
objects can be referenced but not values

yeet just cut 100+ lines from this

var emoji1, emoji2, emoji3, emoji4;
reactCollector.on("collect", async (reaction, user) => {
// 'reaction' is the reaction that the user reacted with
message.channel.send(reaction.emoji.name);
// 'user' is the user who reacted
});
how would you set each emoji thing to a variable?
why not use DiscordSocketConfig.AlwaysDownloadUsers?
@modest crane Whoops forgot about that. I'll give it a spin
@upper elm 
I'm hosting my bot on heroku right now but i want to be able to store data on a json file, I tested my code with from my computer with node but when i uploaded it through github to heroku it wouldn't save anyone
is this just a thing with heroku?
omg erwin not attaching images as emojis
I think Heroku resets your project files which makes that not possible, at least from what I've heard.
I do think it has database support, but the general rule of thumb is free hosting is limited
true
ive been thinking about switching the hosting service but im too lazy and haven't had any major problems with it so far
thanks for the help
@sudden geyser
im fairly certain heroku doesnt allow local data
apart from whats in your repo
you're killing me 
var emojiArray = [];
reactCollector.on("collect", async (reaction, user) => {
// 'reaction' is the reaction that the user reacted with
emojiArray.push(reaction.emoji.name);
// 'user' is the user who reacted
});
reactCollector.on("end", async (reaction, reason) => {
//console.log(emojiArray)
message.channel.send("emoji react test").then(msg => {
for (var i = 0; i < emojiArray.length; i++) {
msg.react(emojiArray[i]);
}
})
});
``` how to make it work with nitro emojis?
The bot needs to be in the server the emoji came from.
You'd need to react with the emoji ID (the easiest way to do it).
?
If you combined reading the documentation and my advice
Ok
You'd get the right answer first time
So......
It's a function
You call functions with parentheses
Yes?
Which template do you guys think I should use for my JSDoc shit
@slender thistle where are all the mods going?
where are all the mods going?
@midnight blaze heaven
and where are all the bot dev going?
Hell?
@midnight blaze god punished them for making fucking terrible bots that they think everybody likes but it's just them and their friends because all they did was use BotumGhostum and bots made with it are basically clones of one another
we really need to learn what the word effort means
tbh JSDoc has way too many tags @ with a lot of them doing very minor differences
Mods on break because moderating both the website and server is fucking exhausting
Mods on break because moderating both the website and server is fucking exhausting
@slender thistle *just website we have minimods for the server
is there a reason this is undefined
message.guild.channels.cache.filter(m => m.id === message.channel.id).id
if I remove the .id at the very end it is a channel object
Uhh
use find maybe
if you have the ID that you need to get, use get
-p 23
filter returns a collection
@fluid basin i am throwing a fit thank you
if you have the ID that you need to get, use get
nah ID was an example
i need name
``reactCollector.on("collect", async (reaction, user) => {
if (reaction.emoji.id === "758896673023590471") {
}
}``
if the emoji is that id, how can i make the reaction collector stop and go to reactCollector.on("end"?
recommended way of getting reactions is awaitReactions
unless you have specific need to use a reactioncollector
Please heple me of my discord bot files! (yellow arrow part)
Alright why did you remove {} after dependencies
JSON follows a structure of "key", "value" with a comma appended when there's another key-value pair after that
{
"key1": "value1",
"key2": "value2"
}
See the comma?
Yes!
You add it because there's key2 thing after it
If I want to add, say, "key3": "value3", how would I do it?
Alright, seems you either ignored my question or didn't get it
I mean the problem is fine but only the circle part
And I'm trying to help you UNDERSTAND
I didn't ignored my question, but I didn't get it at all
why you're getting those errors in the first place
I don't know
What you have there is a JSON file
Following the proper JSON structure, you have keys to the left and values to the right
Can you show me what one of your keys and what its value are?
key is "name", value is "Fluttershy"
Nice
Now, what I want you to understand is
{
"key1": "value1",
"key2": "value2"
}
Do you see the comma there?
Hello all. I am trying to code a command that allows server managers to set roles that are awarded when a member reaches or is above a certain level. I have made the command part of it. but I don't know how to make it so server managers can add multiple role rewards for multiple levels in one command. how do I do this?
These are currently what I have :
So this is my levelrewards model for mongodb : https://paste.mod.gg/gehoceyodu.js
@whole scarab so. The comma indicates that there's another key-value pair after the comma
{
"key1": "value1",
"key2": "value2"
}
@slender thistle, that didn't solve the problem at all
On authentication , i use bearer token but only when userlogin . but i get rate limited . ratelimit is per account . can anyone tell me reason for it? Ping me pls if someone replied
I'm giving you a fucking example
Not your ready-to-use JSON
Following that example and the fact that you're supposed to enter a comma after each value before another key
how do you solve your issue
{
"key1": "value1",
"key2": "value2"
}
@slender thistle, that didn't solve the problem at all!😢😭





