#development
1 messages ยท Page 1261 of 1

You're bound to learn how it works by converting between languages lol
how can i learn the javascript c:
w3schools
books, tutorials online, classes
uh
?
I think this dude is confusing this channel for his twitter feed.
Is that just straight up spying with your bot? lol
if you don't specify any intents, do you receive every event?
idk
You do not, unless you apply to get them.
ah ok, so every event besides the privleged ones
if you don't specify any intents, do you receive every event?
@sonic lodge for now yes
Ok
hey does anyone know how i get a mongo-uri?
An ody
but in the future you have to specify intents, it's mandatory
oki
the hell is an ody
Anyone for discord.py
How about you just ask your question
yeah whats your issue? I'll try to help
where can i find a mongo-uri?
And even youtube video alerts
do you know how to make a discord bot?
Yes
I need help in addi g music commands
@earnest phoenix just ask
you install a mongo server
@eternal osprey Are you talking about a connection string?
I'm not sure what a mongo-uri is otherwise
and you get the URL for it
@earnest phoenix I haven't yet played around with streaming music, but I figure to stream from YouTube, you need a library that can access it. I think there is one (youtube_dl?) then there is a few other things you would have to make from there. From what I understand, youtube_dl downloads the music then you would have to play it. For YouYube Notifications, I would say try a webhook, but I can't remember if I saw that you can't use those on YouTube somewhere
so i launched my translated bot to the world, and this was uh... unexpected....
one day of ability to pick a language and the most popular language chosen apart from english is portugese
Interesting
i kind of expected it to be turkish, i guess DBL is its own little ecosystem ๐
turkish
lol same
Comon pls Moderator
uwotm8
Comon pls Moderator
@earnest phoenix stop begging for mod. Especially in #development
: (
begging for mod needs to be done in #memes-and-media because that's where you belong.
yoo i just made a cluster
i feel cool now
i still don't know where i can get my mongo_url
in atlas or local?
atlas
click the green 'connect' btn to get the connection string
owhh is that the url
The "connection string" is how you connect to dbs
sql user
but'
what, you just need to copy the connection string
so from :
that's what you wanted right?
to "
if (command === 'help') {
let args = message.content.toLowerCase().split(/ +/)
let command = commands.get('name') || commands.find(c => c.aliases && c.aliases.includes(name));
if (!command === '') {
return message.reply('that\'s not a valid command!');
}
data.push(`**Name:** ${command.name}`);
if (command.aliases) data.push(`**Aliases:** ${command.aliases.join(', ')}`);
if (command.description) data.push(`**Description:** ${command.description}`);
if (command.usage) data.push(`**Usage:** ${prefix}${command.name} ${command.usage}`);
data.push(`**Cooldown:** ${command.cooldown || 3} second(s)`);
message.channel.send(data, { split: true });
}```
didi i do this right?
in v12
pretty sure ive seen that code somewhere on youtube
in the docs yes but i am trying to get it to just work for a min
no i got some of this in the docs
Why is args defined if you're using it nowhere inside of that scope?
idk how a object could be equal to an empty string
// You confirm here that command isn't an empty string
if (command === 'help') {
const args = message.content.toLowerCase().split(/ +/);
// Then you reassign command
const command = commands.get('name') || commands.find((c) => c.aliases && c.aliases.includes(name));
// And you check if it's empty... ?
if (!command === '') {
return message.reply('that\'s not a valid command!');
}

oh there's a lot of things going on in that code
wait are you the person they told to learn js yesterday
MongoError: database names cannot contain the character ' '
what does this mean?
nvm it worked
however
i am getting a new error which i just don't undertssasnd
2020-09-22T14:47:58.723Z error: MongoError: user is not allowed to do action [find] on [<dbname>.twitter_feeds]
i have looked through that
do you have permissions set up correctly?
Since find is a priv action
https://docs.mongodb.com/manual/reference/command/find/#dbcmd.find
Is it possible for a bot to notice when a new member is given a role, then based on the role given dms that user to tell them they've been given the role?
I know it's possible to use reacts to give roles and dm a user but I'm not sure if when the role is manually given for the bot to then dm
do i have to define that option in vcs or mongodb itself?
If there is an event for that, it'd be easy
Otherwise, you'd have to search on an interval
Hello, I have an issue with the .setNickname() function.
const reportedUser = message.mentions.users.first();
const member = message.guild.member(reportedUser);
const nickname = member ? member.displayName : null;
getToxicity(nickname).then(toxicity => {
if (toxicity > 0.90) {
reportedUser.setNickname(goby.init().generate(['adj', 'pre', 'suf']));
}
It's saying TypeError: reportedUser.setNickname is not a function
do i have to define that option in vcs or mongodb itself?
@eternal osprey atlas has an area for security and perms options
auger is the best
You could set it to be more secure at some point
i already had done that
have*
still didn't work
2020-09-22T14:54:48.438Z error: error reading from mongodb FeedsModel
2020-09-22T14:54:48.438Z error: MongoError: user is not allowed to do action [find] on [<dbname>.twitter_feeds]
@thick gull Fixed, thanks!
Does you connection string start with "mongodb+srv://bilaltjee" ?
no
well that's the user
lol
that has all the access
so make sure your conn string is right
What vps specs recommended for bot hosting?
as trust you and i am not going to do anything important with this mongodb
Just don't include the password
Can someone answer my question please?
be patient
^
Alright sorry.
and it doesn't need to be powerful. I'm running one on an old cell phone lol
Lol you can run bots on phones?
Any VPS that lets you run nodejs is a VPS that's fine to run bots.
indeed you can
Unless you're doing music bots. Then you're SOL
i was running my on a Wii
@opal plank wtf lmaooo nice
just check for local storage and/or ram
check locally if you bot can reliably run on 3Gb ram
Alright, thanks for the answers and sorry for disturbing!

setTimeout(() => {
guy.roles.remove(role.id)
}, i * 1500)```
I want to have a cooldown in a roleall command, but uh I get this:
(node:8304) TimeoutOverflowWarning: 875807000645271600000 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
(node:8304) TimeoutOverflowWarning: 812158590250254500000 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
(node:8304) TimeoutOverflowWarning: 1.0502741905358193e+21 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
i being the key, that's the ID, and the ID is too large to be used as an integer.
forEach on a collection gives you the value, then the key, then the index
Yeah but what happens when you multiply a string with an integer? ๐
ooooh
TypeCasting FTW!
yeah thats the issue
i didnt even see that bottom part lol
why the heck they even multiplying it for?
how can i like run something if 2 strs not in war
var*
so for exaple if arg = 'true' or 'false' DONT RUN
but if not
run
not js i assume?
just... equality check
python
does py not have a OR operator?
sure it does...
i dont know py enough so i might be running my mouth off with stuff that you clearly know(as this is very basic and ive seen you use more advanced stuff previously)
can you not add a not there aswell?
to inverse the signal
i dont know py enough so i might be running my mouth off with stuff that you clearly know(as this is very basic and ive seen you use more advanced stuff previously)
@opal plank theyres a bit of a bottleneck
i can do the advanced stuffies bc i understand the logic
but im not good at python
so its like i can do xomplicated stuffies on my own, but basic python isnt my strongsuit
if not(arg = 'true' or 'false')
python discord and the same
i would assume something like that would be doable
thats just py syntax
thanks! ๐
not should be an inverted signal
so you run a NOT rather than a IS
if (!comparator) js equivalent i'd assume
i simply cannot believe this
it was definetly the lib throwing the errors unecessarily
1k query and not a single ratelimit
Lets go for 10k see what happens
Hmmm... I'm trying to set reportedUser to a user object, but I want the bot to understand user IDs as well. How could I do that?
const reportedUser = message.mentions.users.first();
|| message.content
but thats rather basic
you could use args[0]
or you could improve even further
and use a unique identifier
I assume it'll be something like
const reportedUser = message.mentions.users.first() || guild.users.find(args[0])
How could I get the user object, though?
ok
so, client.users.cache.find(args[0])?
ah okay
i'd still do a unique identifier though
How would I do that?
to make sure args 0 is always type of number
try isNaN(parseInt(args[0]))
that way u can check args[0] is a string with a number at LEAST
false=good, correct?
correct
๐
NaN = Not a Number
Yeah IK
Im amazed im even ALLOWED to join this many channels tbh
i might Set the queue to remove duplicates to be completely honest
how would i make a bot reply to a specific word in a message?
how would i make a bot reply to a specific word in a message?
@modern sphinx check if the msg content contains a string
new dev sry
new dev sry
@modern sphinx https://www.w3schools.com/jsref/jsref_includes.asp
ight cool

can someone tell me how to add custom status to my bot?
I'm not sure.
you cant
at least not yet, discord said they would probably allow it in the future, but its not a priority for them
for now you can only use playing, streaming, listening and watching
is there a way to make this look good on mobile?
@faint prism still a bit confused
Elaborate
at least not yet, discord said they would probably allow it in the future, but its not a priority for them
@quartz kindle well then, but how?
how would i write it?
Is knex.js still a big boy?
or are there better alternatives
๐ณ
It's still big
gdammit
@modern sphinx Did you read the example in the link?
yes?
What's confusing you then?
str.includes(yourSpecificWord);
And if you look on https://discord.js.org/#/
1 time in a cool embed and once as image itself
@earnest phoenix how what
@modern sphinx So that should answer your question
how to make the status to playing a game
in discord.js its client.user.setActivity() or setPresence()
setActivity is only for the activity, playing watching etc
setPresence is for both activity and status (online, idle, etc) at once
because the text content includes an image link
and your embed is an image
hince, 2 images
lol i am stupid asf
lol i am stupid asf
@eternal osprey we already knew that tell us smth new
shut up minecraft ki
ok
kidd
msg not defined
msg not defined
@modern sphinx alright, did you do it like the screenshot example?
msg not defined
@modern sphinx did you name itmessage?
yeah
you did lol
@modern sphinx did you name it
message?
gotta use the right variable names
@modern sphinx copy pasting is fucking terrible
oh wups i did the 2nd message word wrong lmao
mhm
oh wups i did the 2nd message word wrong lmao
@modern sphinx wait do you have multiple message listeners
also you're doing === instead of your original question which was "contains a specific word"
how would i fix it tho?
so, did you just copy and paste....?
i deleted the link
@eternal osprey bruh
remove the link from the NORMAL MESSAGE PART not EMBED
i don't even have an embed implemented you morron
wtf
i don't even have an embed implemented you morron
@eternal osprey https://discordapp.com/channels/264445053596991498/272764566411149314/757994470644908154
but there is an embed here for the second image?
yeah but it is generated by discord itself
try to paste a twitter link here
will do the same
The first one is
yeah but it is generated by discord itself
This ^^_
the second one is your code
no
the first one was mine
second was discords
i want to remove the first image
Well I've never sent an embed accidentally lol
i want to have the embed part
if I post a link http://www.google.com/
just don't want the normal images
yeah
My mistake
it's okay ๐
Your second image is a result of the text content including a link
The first is you setting an image somewhere then?
could i hastebin my whole code?
Probably
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.
i couldn't hastebin for some reason
this is what i have
i couldn't hastebin for some reason
https://hatebin.com, https://hasteb.in, https://hastebin.com, https://paste.mod.gg
here you go 2 forks of hastebin, real hastebin and hatebin.
client.guilds.size is undefined
are you using discord.js version 12?
Discord.js v12 introduces the most breaking of all breaking changes: Caches
Almost every single collection you could directly access methods from have now been moved to their respective "cache" sub-property, so if you want to do things like get() and find() and filter() collections, you now have the joy of adding .cache to everything - almost everything. For example:
message.guild.members.cache.get(userId);
guild.roles.cache.find(r => r.name === "Super Awesome Role");
client.users.cache.get("210246661446959104");
I say almost all, because some things here and there have remained collections, and they're scattered all over so you can't just globally replace everything. Here's a page describing all the v12 changes: https://discordjs.guide/additional-info/changes-in-v12.html
Good hunting, and remember kids, everything is hidden in the cache (it's a french pun!)
Can anyone point me in the right direction of a 0auth login using flask?
so like guild_id2 + item:levels?
you can combine conditions using || and &&. Check https://js.evie.dev/conditions#conditions-can-be-combined for more information, @drifting wedge
that's python? shit that looks identical to javascript.
oh well. probably has and and or or something. look for "combining conditions in python" on google.
@umbral zealot since when does js use :
if(collection.count_documents(f'{guild_id2}' and 'Mod') == 0):```
would this work?
I mean, there's also the fact that some people can't write js for shit, and also the fact that I missed that one small character
@bot.command(pass_context=True)
@commands.has_permissions(manage_roles=True)
async def role1(ctx, member:discord.Member):
await bot.add_roles(user, discord.utils.get(ctx.message.server.roles, name='role1'))
await bot.remove_roles(user, discord.utils.get(ctx.message.server.roles, name='new'))
await user.send(f"Hey, {user.name} you've been giving a role called: {role.name}")
when people join my server they get a role assigned automatically, but when they apply for a role an admin should be able to type the command $role1 and it would give them the right role, then remove the original role. once that is done the bot sends the user a DM saying it's done
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'add_roles'
Is the error i get
did you copypaste that code
from visual studio code yes?
Try to add roles to the user, not the bot
I thought I had
where did you find that snippet for adding roles is what i was asking
because that's as old as my grandma
when the mods roast your
copiedcode
I don't have the problem with copied code
It's the fact that it's outdated af
See discord.py v1.0.0 changelog @tough bramble for future reference, but:
- Anything
serveris nowguild - You are trying to use
userwhen you only havemember - add/remove_roles is a method of a guild, which can be accessed through
ctx.guild(ctx is a Context object, and it has a.guildproperty) - Can just use ctx.guild.instead of ctx.message.guild to fix the option 1
@slender thistle
thanks, so change it to something like this
member = ctx.message.author
role1 = discord.utils.get(ctx.guild.roles, name="role1")
await member.add_roles(member, role1)
new = discord.utils.get(ctx.guild.roles, name="new")
await member.remove_roles(member, new)
p.s. shortcuts like ctx.author are valid
role1, not role 1 
And... almost
Remove member from add/remove role function args
put space in the wrong place haha
Since you already call the functions on a member
it doesn't really make sense to pass the member again
okay
Well, let's one-up that.
python is good, but discord.py is one of the weirdest libs made for it as its syntax is not natural at all
or im just dumb idk
my_string = ["b", "u", "m", "d", " ", "m", "i"]
__import__("sys").stdout.write("".join(my_string[::-1]))
why u have to do __ in PY
Built-in functions, some are function overloads
so if i wanna store guild specific user info, woudl the schema be like this?
users: object,
and i would just do <guild>.users.<id>?
mongoose
mk ty
then u can do guild.members.cache.get()
it wont make ur database big
big datansse is bad
oh
To call a __yolo method of a class Hello, you'd have to do _Hello__yolo()
so
guildID: id,
users: [{level:0, xp:0}]
Something you could consider a private function
save it in array
Most IDEs usually see _method_name as private functions anyway
"users": [
"ID": {
"e":"e"
}
]```
so u*
so like that?
Yes
mk
waitno
?
users:[
{
id:id,
xp:xp,
level:level
}]
isnt that object syntax in an array
perhaps
I thought it's supposed to be wrapped in {}
That what i ment
"users": [
"ID": {
"e":"e"
}
]```
But this?
that wasnt me
that was m e
yeah that's wrong

"users": [
{
"e":"e"
}
]```
pain .
this is right
You know what else is right
im on mobile so i cant highlight the code sorry
Bye imma go eat
can somebody send the docs
ha..ha..ha
But on a serious note, could you clarify which docs?
d.js?
https://discordjs.guide/ I assume?
Is that not what it is
man thats not even exict
Then the guide or docs to what
There we go
shiv correctly assumes that anyone asking for help is asking for discord.js help ๐
not the guide
https://discord.js.org/#/
@umbral zealot thx
@slender thistle u wan not to a big help sorry
was*
actually
I assume that was an insult and that I should be able to read minds
Because I wouldn't have to perform a blind poke into anywhere if you clarified what you needed help with
discord.js documentation's top result is https://discord.js.org/#/ so shiv was actually right?
so if you were a half competent developer you'd google it
ok ok
I made a music bot yesterday but today I'm receiving this error --
code: 403,
message: 'The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.',
errors: [
{
message: 'The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.',
domain: 'youtube.quota',
reason: 'quotaExceeded'
}
]
}
also I cant find the DMcommand like when u type help than ur bot is gonna reply to u DM
How do I increase my quota lol
0.0
also I cant find the DMcommand like when u type help than ur bot is gonna reply to u DM @misty sigil
<Message>.author.send()
// Create a reaction collector
const filter = (reaction, user) => reaction.emoji.name === '๐' && user.id === 'someID'
message.awaitReactions(filter, { time: 15000 })
.then(collected => console.log(Collected ${collected.size} reactions))
.catch(console.error);
@misty sigil
I want it to react while it DM me
how
can u help me
as good as any other database, except postgresql which is superior to everything else on the planet.

Mongo is decent for what it is
Mongo is decent for what it is
Yeah, pretty good NoSQL DBMS
:>
i from germany xD
@earnest phoenix Is there a development question or topic you had in mind?
@faint prism @umbral zealot @thick gull y'all noobs i use XML for storing shit no database not even JSON 
ok
Might as well be JSON
is mongo pc hosted?
i use google sheets
@thick gull goggle shits? did a dolphin shit on your goggles when you were swimming?
cloud version
is there like a tutorial on how to use it
@gentle lynx yes and documentation
is there like a tutorial on how to use it
@gentle lynx lots and LOTS OF THEM
i use XML for storing shit
Do you communicate with your database through SOAP at least? ๐
can you link me a good one
Do you communicate with your database through SOAP at least? ๐
@umbral zealot i use pumice (the rock which soaps are made out of)
can you link me a good one
@gentle lynx https://docs.mongodb.com/manual/
there are literally thousands of mongodb tutorials because freakin' everyone uses it. Goddamn cargo cultists.
google results for "mongodb tutorial": 6,423,426,124
google results for "mongodb tutorial -express": 3
i use pumice (the rock which soaps are made out of)
@earnest phoenix that is clever as fuck.
ok
SQLite ๐จโ๐
im gonna use quick.db ๐ฌ
@gentle lynx I mean, it's non-relational vs relational,
so whatever your use case is
I don't recommend quick.db
ahhhhhhhhh
Let args = message.content.substring(PREFIX.length).split(" "); I got a shit error in this reaction command
"args"
Let
lowercase l
what u mean
let
most keywords are case sensitive
so i have this function
hasPermission: function(permission, message, errEmbed) {
if (!message.member.hasPermission(permission)) return errEmbed(`You can not do that. Missing permission \`${permission}\``);
if (!message.guild.me.hasPermission(permission)) return errEmbed(`I can not do that. Missing permission \`${permission}\``);
},```
which uses another function errEmbed
```errEmbed: function(err, message) {
const error = { color: '#ff0000', description: `${emoji.warning} **Error:** ${err}` };
message.channel.send({ embed: error });
},```
but im unable to understand how to pass my errEmbed func into my hasPermission func

@faint prism
see
whats wrong
then directly after I want it to DM
anybody help?
@slender thistle
dont see an issue here
put a console log in your case statement
ok i fixed the above error
was pretty dumb but im getting
TypeError: Cannot read property 'channel' of undefined
for some reason
i am already pushing message into the function?
yes
@autumn aspen Can you send the actual error message
await embedMessage.react('๐');
await embedMessage.react('๐');
});```
i use object emebeds
so
you didn't put pass message to your errEmbed function inside hasPermission function
mm?
@client.event
async def on_message(ctx, message):
member = ctx.message.author
channel2= ctx.message.channel
if message=="HI":
await ctx.channel2.send('Hello!')
CODE IS ^^
ERROR:
TypeError: on_message() missing 1 required positional argument: 'ctx'
Ignoring exception in on_message
Traceback (most recent call last):
File "/home/dev_veve/.local/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
TypeError: on_message() missing 1 required positional argument: 'ctx'
Ignoring exception in on_message
Traceback (most recent call last):
File "/home/dev_veve/.local/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
TypeError: on_message() missing 1 required positional argument: 'ctx'
oh now i did
hasPermission: function(permission, message, func) {
i said errEmbed
inside that function
you used errEmbed
but you never passed message as second parameter
yes i passed message into it?
const error = { color: '#ff0000', description: `${emoji.warning} **Error:** ${err}` };
message.channel.send({ embed: error });
},```
no
Hey so this might not be the best question to ask Here but Does anyone know any good node.js mobile programming apps cuz my psu just burned
two functions.
if (!message.member.hasPermission(permission)) return func.errEmbed(`You can not do that. Missing permission \`${permission}\``);
if (!message.guild.me.hasPermission(permission)) return func.errEmbed(`I can not do that. Missing permission \`${permission}\``);
},```
func.errEmbed
my goodness
help pls
@client.event
async def on_message(ctx, message):
member = ctx.message.author
channel2= ctx.message.channel
if message=="HI":
await ctx.channel2.send('Hello!')
CODE IS ^^
ERROR:
TypeError: on_message() missing 1 required positional argument: 'ctx'
Ignoring exception in on_message
Traceback (most recent call last):
File "/home/dev_veve/.local/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
TypeError: on_message() missing 1 required positional argument: 'ctx'
Ignoring exception in on_message
Traceback (most recent call last):
File "/home/dev_veve/.local/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
TypeError: on_message() missing 1 required positional argument: 'ctx'
no wait im confused
what
no i said message
when i use $serverCount it show only 2 members even if there is 100 members in the server
@earnest phoenix what program are you using
that's not where the error came from
it's from the hasPermission function
you used errEmbed but you didn't provide message, it's suppose to be errEmbed("error", message) but you gave errEmbed("error")
i didn't know
where can it get the channel if you don't pass message

he meant bdfd
its a free thingy
got it func.errEmbed(`You can not do that. Missing permission \`${permission}\``, message);
its $membersCount
@earnest phoenix it doesn't work
its a bad thingy
hey boys and girl
this is not php
@client.event
async def on_message(ctx, message):
member = ctx.message.author
channel2= ctx.message.channel
if message=="HI":
await ctx.channel2.send('Hello!')
CODE IS ^^
ERROR:
TypeError: on_message() missing 1 required positional argument: 'ctx'
Ignoring exception in on_message
Traceback (most recent call last):
File "/home/dev_veve/.local/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
TypeError: on_message() missing 1 required positional argument: 'ctx'
Ignoring exception in on_message
Traceback (most recent call last):
File "/home/dev_veve/.local/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
TypeError: on_message() missing 1 required positional argument: 'ctx'
Guys
why isnt it php
because it's $variable in php
@earnest phoenix its definitely $membersCount
Can somebody send me an invitation link of a very big server, where people help each other in scripting (in different languages)
why it isn't working than
@eternal osprey you probably run your bot through 2 hosts
huh well thats right but where is my error embed
DiscordAPIError: Missing Permissions
wrap <> on the links
i am not
<http://url>
@ionic shard itโs a permission missing error
@earnest phoenix its definitely $membersCount
@earnest phoenix why it is not working
yes yes
you add it
modifiedText = modifiedText.replace(media.url, <${media.url}>);
@ionic shard itโs a permission missing error
@dapper ocean thats on purpose to get my error embed....
it is already added
@earnest phoenix why it is not working
@earnest phoenix your problem
hastebin
but i type the same thing you said to me
I need to use a animated emoji but I don't have nitro, Is there anyway I'd be able to find out the emoji id without me sending it? The only way I know if is \:emoji:
can anyone help me with the problem i had?
lemme grab the docs rq
my code sends 2 images
you have it to send the image and the link
my hastebinned code
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
you want just the link
Your sending a link, And the link is being embeded
yeah i just want the link
You could use <whatever code>
so remove whatever sends the image then
also thanks @opal plank
okay half done.
https://codeine.is-inside.me/xL3Fj6OV.png
it should have not continued from the 1st error
https://codeine.is-inside.me/D3d8cUPL.png
can you even bulkdelete?
yeah?
@ionic shard use return?
isn't that against the api
@eternal osprey no
oowh my bad.
@ionic shard use return?
@misty sigil https://codeine.is-inside.me/XBxzvE1B.png
ooh
his bot sends image and the link
sendds 2 images
Take out the link from the text content
but when i do
okay wait
let me try.
but i want it to be in the twitter embed
๐ฆ
Take out either the ${modifiedText} bit or where you set the embed
@eternal osprey remove the image
you either post the link and let discord generate the embed
or you make one and set its image url with a regex
that is what i am trying to do
you're doing both it seems idk JS, disregard me
both you should use regex
but it doesn't work as you just saw from the ss
nah auger
he isnt making an embed
he's just posting a link in chat
which discord embeds
(from what i understood)
what's the difference between kicking and banning a bot? can bots join servers on their own?
nope
bots need to be added by a user
so either should get rid of the bot until someone in your guild adds them back
oh, so banning just makes it so some user cant add it again
man im so confused
welcome to development
...
ok on topic
i have a function which does this.
func.errEmbed(`You can not do that. Missing permission \`${permission}\``, message);
return;
}
if (!message.guild.me.hasPermission(permission)) {
func.errEmbed(`I can not do that. Missing permission \`${permission}\``, message);
return;
}```
but when i call it
you shouldnt od that btw
ofc its gonna return from the function and not where i called the func
you arent accounting for channel overrides
will fix this later.
my main concern rn is
so it still runs the purge command im tryna make
I want to make a prefix for my bot but I when I fix it it can have all random symbols for prefix
how to fix?
if you return on a blocked scope it target the scope its in
ofc its gonna return from the function and not where i called the func
@ionic shard yes thats what i said
return the function without the brackets
then fix it
that return there is doing absolutely nothing
its completely redundant
bot.on('message', message => {
let msg = message;
let args = msg.content.slice(prefix.length).split(/ +/);
let command = args.shift().toLowerCase();
let cmd = command;
if(cmd === 'help') {
if(!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.channel.send("โ **You don't have permission to run this command!** โ");```
```
e
@opal plank where do I fix the prefix here
`?
first, use code blocks
wdym
this
```js
//code here```
not quite
do discord bots fall under SoftwareApplication in the schema.org hierarchy?
https://schema.org/docs/full.html
Schema.org is a set of extensible schemas that enables webmasters to embed
structured data on their web pages for use by search engines and other applications.
//code here
if(pretty) code blocks cool```
if i run a var inside the ifs
set em to false
check if its true on main file and run if its not is it the best way to do this?
prob poor design if you running it on multiple commands
i am
then its probably best to keep the logic inside that command
i wouldnt bother with function i only needed for 1 command
ugh
bot.on('message', message => {
let msg = message;
let args = msg.content.slice(prefix.length).split(/ +/);
let command = args.shift().toLowerCase();
let cmd = command;
if(cmd === 'help') {
im gonna rip my hair
assign a variable to your prefix @autumn aspen
@autumn aspen https://www.w3schools.com/js/
you have 2 options dogo
yes
Option 1: https://discordjs.guide/#before-you-begin Follow the guide and pray you understand what it means with its examples
Option 2: https://www.w3schools.com/js/ Study at LEAST the bare minimum of how Javascript works.
Option 3: Try your luck to find someone who's willing to hold your hand throughout the whole process of making a bot
Option 1: https://discordjs.guide/#before-you-begin Follow the guide and pray you understand what it means with its examples
Option 2: https://www.w3schools.com/js/ Study at LEAST the bare minimum of how Javascript works.
Option 3: Try your luck to find someone who's willing to hold your hand throughout the whole process of making a bot
@opal plank I have a guy that can spoonfeed the whole shit but nah I want to learn
odd question but what language should i use when starting coding a bot?
then i'd recommend basics of JS first, which SHOULD be a requirement for trying to get a bot. WHile the stuff you doing rn isnt complicated in the slightest, you DO need some basic understanding of how javascript works.
Otherwise THIS is gonna happen:
You'll have an idea.
You'll come here asking how to do it.
You'll try go and do it based of what people here will tell you.
Then you either come back asking for MORE help beacuse you lack that basics or you'll somehow pull it off.
Then that loop ^^ will repeat until people get tired of spoonfeeding you the whole time.
Hence why i'd highly recommend skimming thru the basics of Javascript to get a hang of what it feels like to code
Use your bot to test the basic things js has to offer, read the pages of this https://www.w3schools.com/js/ and put into practice every chapter
@autumn aspen
fair warning, regex is a monster of its own kind
expect a somewhat medium/high difficulty grasping it
thanks
do u guys have any suggestion for a program i can use to make android apps?
my bot doesnt show custom emoji
<:drobot:758014173136420916>
exports.run = (client, message, args) => {
const user = message.mentions.users.first() || message.author;
const Discord = require("discord.js");
const avatarEmbed = new Discord.MessageEmbed()
.setColor(message.member.displayHexColor)
.setFooter('Komut ' + user.username + ' tarafฤฑndan istendi.')
.addFields(
{ name: 'd!hesapla', value: ':drobot: ฤฐลleminizi hesaplar.' },
{ name: 'd!hesapla', value: ':drobot: ฤฐลleminizi hesaplar.' },
)
message.channel.send(avatarEmbed);
}
it changes to :drobot :
@half bear usually that means ur bot doesnt have access to that emote
bot have administrator perm
yes in the same guild
are you sure?
absolutely sure?
yes
is the emoji in your server?
huh?
wdym same token as ur server?
Hmmm theres an easy solution for this
Dm me your server invite
k wait
another happy customer
problem solved, thanks to* @opal plank
wow
Now 9k more and im able to properly test my cache
cannot believe this big ass code ran first time
@client.event
async def on_message(ctx, message):
member = ctx.message.author
channel2= ctx.message.channel
if message=="HI":
await ctx.channel2.send('Hello!')
CODE IS ^^
ERROR:
TypeError: on_message() missing 1 required positional argument: 'ctx'
Ignoring exception in on_message
Traceback (most recent call last):
File "/home/dev_veve/.local/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
TypeError: on_message() missing 1 required positional argument: 'ctx'
Ignoring exception in on_message
Traceback (most recent call last):
File "/home/dev_veve/.local/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
TypeError: on_message() missing 1 required positional argument: 'ctx'
PLS HELPPPP
๐
then how do you send messages
message.channel
so await message.channel.send?
Try it
k
@client.event
async def on_message(message):
member= message.author
if message == "f":
await message.channel.send(f'{member.mention} has payed their respects!')
if message== "F":
await message.channel.send(f'{member.mention} has payed their respects!')
if message== "no":
await message.channel.send('yes')
if message=="No":
await message.channel.send('yes')
if message=="Hi":
await message.channel.send('Hey there!')
if message=="hi":
await message.channel.send('Hey there!')
if message=="how":
await message.channel.send('well yes but actually no')
if message=="How":
await message.channel.send('well yes but actually no')
if message=="meme":
await message.channel.send('pls meme')
if message=="bruh":
await message.channel.send('bruh')
if message=="Bruh":
await message.channel.send('bruh')
Its not even printing antthing
or conncecting
how can i check if a var is equal or more than a number?
also, that sounds like a very annoying bot
PLS HELPPPP
![]()
![]()
you do realize that you're comparing a Message object to a string
and not its content
OHHHH
i see wy
ikr
those if*
Maybe its a good idea to read the discord.py docs first lol
wAit its all if
Guys quick question what is the command for await
the command for await
???
like I want my bot wait to respond
await is an operator
for await?
Py or js
await is for asynchronous operations
js
await has literally zero correlation to the bot, it's a keyword for an asynchronous wait
Js
use setTimeout






