#development
1 messages Β· Page 1287 of 1

I can still moderate as I'm only on break but I admit I was wrong
Didn't see that search query
ok
Mods on break can still backseat mod 
OK, that updates all my public bots. Wonder how long that was broken.
@rustic nova
how to i get a users discriminator/hashtag using member.
member.user.discriminator
thanks
guys how do i make my bot join a voice room
hi need help
const Discord = require("discord.js");
const client = new Discord.Client();
const prefix = ".";
//required starts
if(cmd === ${prefix} ping )
// It sends the user "Pinging"
message.channel.send("Pinging...").then(m =>{
// The math thingy to calculate the user's ping
var ping = m.createdTimestamp - message.createdTimestamp;
// Basic embed
var embed = new Discord.MessageEmbed()
.setAuthor(Your ping is ${ping})
.setColor("Your Color")
// Then It Edits the message with the ping variable embed that you created
m.edit(embed)
});
this explains nothing :P
is there any error in the code?
what do you need help with
is there any error in the code?
hard to asume from whitetext
in line 6
also why not sending the error?
...
- embed has no real color
cmd === ${prefix} pingnot correct- where are the
;? - use const/let
- where is the onMessage
k
hi i need some help
i just started hosting my bot on heroku
and i know nothing about it
so how do i update it when i make any changes in my code
it gets updated on my git rep also but the bot isnt still sending the updated version
Heroku should be connected to the repo
Make sure you have the git program on your pc, there's where you commit changes to the master branch
yea it is connected
and i have it as well
the bot was working when i connected it initially
but when i made a change and updated it it didnt work
What do you guys use for premium versions of your bot?
Do you have like a code system where a user gets a code to activate the bot in a server or... idk, what do you use?
Yeah Obv
But how do you limit the servers where he can join
someone help plz
with what 
Is there a way to see how many times a user used a command in a day in djs? Like a collection or something?
hello please top gg new bot html
?

html
write 
Oh
tΓΌrkΓ§e bilen yokmu
#general-int for turk
html is like the easiest language out there
or just use markdown
It's just markup
yea
:u
khe pedo v:
Hello I would like to know if the bot can register the user's highest permission? It would help a lot to know if it is possible to do this.
CSS is meh. It has a lot of property names I can't remember half the time
But it can do a surprising amount of visual stuff
it can
discord.py
how do i save a list with json?
css has a lot of depth
I feel like everytime someone posts their custom page here I really need to do a better job lmao
it also has 3d stuff and other interesting things
but making it just what you want is hell
discord.py
how do i save a list with json?
help pls
I was good at css
@violet mesa google is invented
@compact oriole i tried i didnt find an answer
but making it just what you want is hell
@compact oriole most people just do their stuff with JS nowadays for fancy visuals
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.
yea
I use Nextjs (React) and I use a lot of js to make my effects
or use third party libs
import json
encoded = json.dumps(obj)
obj = json.loads(encoded)
I would like to know if the bot can register the user's highest permission?
in discord.js
register the user's highest permission
Can you elaborate?
What's the behavior you're trying to code?
I'm doing a userinfo and would like it to look like this: Higher permission: $ {permissions}
I read the documentation but didn't quite understand
Thank you for reading the docs first π A lot of people don't do that
There is a highest property I think
https://discord.js.org/#/docs/main/stable/class/GuildMemberRoleManager?scrollTo=highest
Thank you for reading the docs first π A lot of people don't do that
oh
I meant that as a compliment
message.member.roles.higherst
message.member.roles.higherst
@silver lintel he want's the permission flags
I got it checked, but I deleted my bot and I'm starting again
why do people get cringy names with custom font and long :P
No fr When do i get verified bot?!
@earnest phoenix On DBL bot verification is +6 weeks
It's in the pins in #support
l0l
@earnest phoenix If you're trying to get the badge, ask here
https://discord.gg/discord-developers
||I love their bot that replies when people mention the badge||
that server doodoo
today is halloween?
Is there a way to detect unicode, emojis or special fonts in a username (in d.js)?
Probably need a library for that
you can check the character's length
Regex?
Idk about regex
That might work for emojis
But the other two would be checking for characters outside the standard char codes
oh
hey, do that
check if there are char codes present outside the typical range
Alright ty
badges are not given anymore afaik
Bug hunter badges are for people who find bugs
idk about that one
Is that not obvious...?
go to its website and click invite
if your server doesnt show up, you're logged in in the wrong account
go to the discord website, logout, and login again
Okie okie ty
Guys I got A on the P.E when u have a map and find controls also I got C on the latest math test today is that good?
wrong channel?
life development
lmao
@bot.command()
async def buy(ctx, *, args):
await open_account(ctx.author)
users = await get_bank_data()
user = ctx.author
buyable = ["computer", "sniper", "candy", "fishing poll", "lottery ticket"]
isbuyable = args not in buyable
if (isbuyable == False):
if (args == "sniper"):
if (users[str(user.id)]["wallet"] >= 1500):
users[str(user.id)]["backpack"].append('sniper')
await ctx.send(f"succefully bought {args}")
elif (args == "computer"):
if (users[str(user.id)]["wallet"] >= 10000):
users[str(user.id)]["backpack"].append('computer')
await ctx.send(f"succefully bought {args}")
elif (args == "fishing poll"):
if (users[str(user.id)]["wallet"] >= 20000):
users[str(user.id)]["backpack"].append('fishing poll')
await ctx.send(f"succefully bought {args}")
elif (args == "fortune cookie"):
if (users[str(user.id)]["wallet"] >= 1000):
users[str(user.id)]["backpack"].append('fortune cookie')
await ctx.send(f"succefully bought {args}")
elif (args == "candy"):
if (users[str(user.id)]["wallet"] >= 10):
users[str(user.id)]["backpack"].append('candy')
await ctx.send(f"succefully bought {args}")
elif (args == "lottery ticket"):
if (users[str(user.id)]["wallet"] >= 200):
users[str(user.id)]["backpack"].append('lottery ticket')
await ctx.send(f"succefully bought {args}")
else:
await ctx.send("you dont have enough money to purches this item")
else:
await ctx.send("this item is not buyable do d!shop to see list of items")
in open_account function
vvvvvvvvvvvvvvvvvvvvv
users[str(user.id)]["backpack"] = [None]
async def open_account(user):
users = await get_bank_data()
with open("mainbank.json", "r") as f:
users = json.load(f)
if str(user.id) in users:
return False
else:
users[str(user.id)] = {}
users[str(user.id)]["wallet"] = 0
users[str(user.id)]["bank"] = 0
users[str(user.id)]["backpack"] = [None]
with open("mainbank.json", "w") as f:
json.dump(users,f)
return True
async def get_bank_data():
with open("mainbank.json", "r") as f:
users = json.load(f)
return users
why does this no work
and how can i fix
were there any error
What doesn't work?
What is this
What is this
@cobalt mural A refernce to the current object
message.channel.send(embed).then(m => {
m.react("β")
})
}
Yo why does this not work?
m is not defined?
how
if (message.content === '!react') {
message.react('π');
}
That code looks fine @autumn aspen
i fixed it
m is not defined?
@autumn aspen because the message was never sent successfully
discord.js doesn't care if the message was successfully sent or not
so it still returns a promise
and executes the callback
with no message object passed
hence m is not defined
lemme test if i was correct
.then will be called if the promise resolved.
.catch will be called if the promise is rejected.
The .then callback does not look like the root of the error.
It would be easy to debug with the stacktrace so it would point to the exact line causing the error.
@earnest phoenix for the record, promises are a JS thing. Discord.js wouldn't pass nothing to the resolving promise, and if it did, m would just be set as undefined.
i just ran his code
it doesn't work
but there is no error saying m is not defined
nothing
the bot sent a message uwu but the stuff inside .then wasn't executed for some reason
are you sure you saved the file and restarted your bot
and that the error came from that line of code
Then you probably did something incorrect along those lines code913
It's written correctly.
have they changed read_json ?
Ignoring exception in on_ready
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "OwO.py", line 132, in on_ready
data = json.load("blacklist")
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/__init__.py", line 293, in load
return loads(fp.read(),
AttributeError: 'str' object has no attribute 'read'```
I don't get it
It's randomly working and not working
this is starting to bug the ** out of me...
what's blacklist supposed to be?
Then what did you define fp as and what did you expect it to be
(please ignore the fucked up embed on mobile)
oh wait I think I see
fp comes from python so you're calling it without the correct type
causing the error
message.channel.send(embed).then(m => {
m.react("β")
})
}
@pale vessel it's a Json made to Block people in the Blacklist from using the bot..
that doesn't look like json
@pale vessel it's a Json made to Block people in the Blacklist from using the bot..
@earnest phoenix JSON DATABASE AAAAAAAAAAAAAA
isn't the first argument supposed to be a file
lemme test if i was correct
@earnest phoenix dude how do I make it reacts
yh, SQL dashboard doesn't work on mac, @earnest phoenix.
it should be a file, yes https://docs.python.org/3/library/json.html#json.load
@earnest phoenix dude how do I make it reacts
@autumn aspen there is a random closing brace at the end of the code that you gave
lemme run it and show you
so it's json.load() not read_json() @pale vessel ?
yes and you did use that
hm,
json file yes
@earnest phoenix ```js
message.channel.send(embed).then(m => {
m.react("β
")
m.react("β")
})
}
what is the filename?
bruh what wrong
blacklist.json
@autumn aspen there is a random } at the end
please learn to read what we said
you need to open the file first fp = open("blacklist.json") and then you can use json.load(fp)
@autumn aspen there is a random
}at the end
@earnest phoenix then I get an error
problem in terminal
can you send the error?
@pale vessel ```js
module.exports.run = async (client, message, args) => {
the bracket at the end
can you hastebin the file, perhaps?
@pale vessel emm whats that again
bruh send the link
bruh send the link
@earnest phoenix how its the same
https://hastebin.com/
@pale vessel can u see it now?
hm, nope
Weird... sending a client presence update and receiving a Session closed: reason: "Unknown opcode."
3 Presence Update Send Update the client's presence.
Isn't it possible to set the BOTs status anymore?
bruh how
try using https://hasteb.in
the code looks right
yes but it doesnt react
are there any errors?
did it at least send the embed?
now when i run the command the bot wont respond but theres 0 errors i wanna smash it to bits
did it at least send the embed?
@pale vessel yes
cry
π
how do i detect a new server join and who it was invited from
how do i detect a new server join and who it was invited from
@shy turret google it
@boreal iron does it happen any time you send one
Yeah
and im too lazy to read docs
@shy turret wll that ur pb
https://github.com/AnIdiotsGuide/discordjs-bot-guide/blob/master/coding-guides/tracking-used-invites.md amazing v11
Study the docs like the bible @shy turret
are you using a library
Weird, gonna try the API call right now, but it's not documentated
you won't get no where if you don't π₯²
nope I'm not
@shy turret google it
@autumn aspen says the guy who can't google stuff himself
π
https://anidiots.guide more updated
don't attack him π¦ @earnest phoenix
bruh
take deep breaths
that's not attacking
gonna send an API request to /api/v6/users/@me/settings no docs found
I wouldn't call it attacking. I'd say it's still rude.
using the "custom_status"
You canβt
I wouldn't call it attacking. I'd say it's still rude.
@sudden geyser ^^^
bots can't use custom statuses
they can only have four kinds of statuses
playing, streaming, listening and watching
and offline
the online/dnd/idle/invisible stuff aren't considered part of actual custom statuses
Yeah sending an presence update with OPCode 3 doesn't work for some reason 3 Presence Update Send Update the client's presence.
Session closed: reason: "Unknown opcode.
weird
because bots can't set fully customizable custom statuses they can only have playing, listening, streaming and watching
lemme show you with my bot
yeah I got that, but it doesn't explain the Unknown opcode. response
ran
c.eval Client.user.setPresence({
activity: {
type: "CUSTOM_STATUS",
name: "uwu"
}
});
the bot status just disappeared until i set it to STREAMING as type
but there is no way you can remove the Playing/Streaming/Listening to/Watching part
because discord is gay
This server has more messages with "fuck" in it that my server with normal messages including "fuck"
it's not fully supported yet on bots @earnest phoenix
This server has more messages with "fuck" in it that my server with normal messages including "fuck"
@hazy sparrow welcome to a 13+ chatting app
ty
Fuck
you
Sorry papa
π development
But how the fuck do you fucking put "fuck" like so many fucking times in 1 fucking message
But how the fuck do you fucking put "fuck" like so many fucking times in 1 fucking message
@hazy sparrow we type
also #general
G!YardΔ±m
{ "op": 3, "d": { "activities": { "name": "some music", "type": 2 } } }
"Unknown opcode."
well... idk
shouldn't the payload be a json (as string)?
it is...
socket.send(JSON.stringify({ "op": 3, "d": { "activities": { "name": "Test", "type": 2 } } }));
v6
try v8, the latest
wut
September 24, 2020 oh missed that
lol they switched from 6 to 8 @ sep 24 and I missed that
stuff should still work in v6
yeah, still the default
deprecated is different from discontinued as you can see
yeah but for example opcode 3 is unknown, which means I can't edit the presence
need to upgrade I guess
probably, yeah
"Invalid intent(s)." alright... need to study the docs right now
that should just be under the identify payload just invalid, already provided
it's close
Yeah, October 7th is close
5 days more here
@earnest phoenix I think you're supposed to call that on an instance of the class (I think AutoShardedBot is a class).
@boreal iron wait are you freaking trying to use the API without a wrapper 
Else it expects the first argument to be the instance, than the rest being the arguments to the method
don't need to use a lib... works for "like always"
just pure JS (incl. jQuery) and some PHP for the API requests
also may I ask what theme you're using
quite enough for what I need to do
light theme
not you xd
i actually like light theme
flashbomb utility
anyway thx for the hint with v8... gonna study the docs right now b
I guess people shit on it because it used to be
Ignoring exception in command blacklist:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 83, in wrapped
ret = await coro(*args, **kwargs)
File "OwO.py", line 213, in blacklist
data = read_json("blacklist")
File "OwO.py", line 188, in read_json
data = json.load(file)
NameError: name 'file' is not defined
The above exception was the direct cause of the following exception:``` i Actually want to just throw my Pc out the window..
rasmus doesn't even code the current php we know but still, we meme about it
happy little girl noises
What is file supposed to be?
blacklist.json
Show your code
did you use open()?
uh why not? using ajax calls for events, using POST method to my PHP handlers
with open(f"blacklist.json", 'r') as f:
data = json.load(file)
take a closer look
See what doesn't make sense?
f xd
It's common to call an open file f or file tbf
he used file instead of f, isn't that the problem?
Mhm
π
Take it slow
take it despacito mate
Distract yourself for a bit, watch a few videos, calm down
Still progress :p
yuhhh
How can I fix this error?
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []```
π
he did it
plss help me
did γͺγ³γ―γΉ do it?
hey guys!
lmfao, at least you figured it out
@west agate can you show other part of the code?
how do i create a stop interval command?```js
if (message.content.startsWith(prefix + 'feed')) {
let channel = message.mentions.channels.first();
{
const args =
' ' +
message.content
.slice(prefix.length)
.replace(/^feed/, '')
.replace(/<#\d+>/, '')
.trim();
queueMessageText = '**The twitter feed has been searched and sent by this/these keyword(s): **';
queueMessageText +=
' ' +
message.content
.slice(prefix.length)
.replace(/^feed/, '')
.replace(/<#\d+>/, '')
.trim();
const messageToEdit = await channel.send(queueMessageText)
function generateEmbedFromFeed(query, callback) {
T.get('search/tweets', { q: query, count: 1 }, function(err, data, response) {
const status = data.statuses[0];
console.log(status)
const embed = new Discord.MessageEmbed();
embed.setTitle('Twitter Feed Poster');
embed.setDescription(`${status.text}`);
embed.setImage(`${status.user.profile_image_url}`);
embed.setFooter('Command created for Pokehub!');
embed.setColor('#FF0000');
embed.setAuthor('@' + `${status.user.screen_name}\n` + `${status.user.name}`);
embed.setURL(`https://twitter.com/${status.user_screen_name}/status/${status.id_str}`);
return callback(embed);
});
}
generateEmbedFromFeed(args, (embed) => {
// once the twitter search is resolved, we can edit the original message with the embed
messageToEdit.edit(embed)
})
// again every 5 seconds
let testing;
setInterval(() => {
generateEmbedFromFeed(args, (embed) => {
messageToEdit.edit(embed)
})
}, 5000);
}
}``` this is my code.
? @pale vessel
like i already tried clearinterval(testing)
uhh... intents are quite useful, specially for me only watching sent messages. wondering why this wasn't in earlier already.
wouldn't that just send the same embed over and over?
you're not fetching the data again
you're using the previous data aka embed
wtf is that
and why doe sit send like 5
try checking your updateTime
how would i get the new data?
@west agate make a function for it
How can I fix this error?
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []```
- use const not let
- discord.Embed? (use {} to open just embed)
let is used if you plan to change the data
const if it is not gonna change
const and let gang
aka not gonna get overwritten
fuck vars π
fuck vars 
How can I fix this error?
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15) at Function.Module._load (internal/modules/cjs/loader.js:841:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []```
@earnest phoenix ???
"FallGuys ModMail"
doesn't sound like a module
wdym?
- use const not let
- discord.Embed? (use {} to open just embed)
@compact oriole u want me to make another embed and send it?
also not showing code doesn't help @earnest phoenix
@compact oriole u want me to make another embed and send it?
not talking about embeds
@west agate make a function for it
@pale vessel how?
exist permissions.hoist?
wrap the fetch and sending part inside a function and set an interval that runs the function again
discord.js
@earnest phoenix what
permissions.hoist does not exist, only role.hoist
wanted to put the biggest permission to appear
use member.roles.highest
you can also sort their roles by position
I wanted permission
;-;
GuildMember#permissions will return all member permissions
highest permission?
How can I fix this error?
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15) at Function.Module._load (internal/modules/cjs/loader.js:841:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []```
@earnest phoenix pls help me again
thonk
@earnest phoenix how can i apply this?
How do I do the ? Thing : thing for true and false things
@earnest phoenix you still didn't answer
also not showing code doesn't help @earnest phoenix
@compact oriole
condition ? <if truthy> : <else>
aka show code or not gonna help
Required settings
-----------------
token =
mainGuildId = 751182786756476968
mailGuildId = 751182786756476968
logChannelId = 761586206102126593
categoryAutomation.newThread = 761585942716481577
Add new options below this line:
----------------------------------
responseMessage = Thanks for messaging our FallGuys Modmail! We will next to you as soon as possible!
closeMessage = Your ticket was closed! Dont answer to this message only if you need more help
mentionRole = 761586690200436746
i am making a modmail
from the source code
rtd @earnest phoenix
@earnest phoenix what is?
rtd
read the docs
Guys, Before that, my bot had an error 429, it passed in Β± 5 days, but now it appears again, although nothing was touched
how do i post to a url? so for example, i want to post guild count to a url, how do i do that?
@pale vessel ty
how do i post to a url? so for example, i want to post guild count to a url, how do i do that?
@clever dust you mean an HTTP POST request or just yeeting data to a website in general?
@compact oriole you talking to me?
no
@clever dust you mean an HTTP POST request or just yeeting data to a website in general?
@earnest phoenix http post
aka use a library like axios
ok but what can I make for my problem?
like I said before

you told me to send you the code
i used to use node-fetch but now i made my own request wrapper
you told me to send you the code
you didn't
fetch is annoying with their res.json() and text()
i used to use node-fetch but now i made my own request wrapper
I usually use node-fetch or axios :P
but for some reason axios broke for a bit
discord.js uses node-fetch
i never used axios, just felt like node-fetch was good enough for me
fetch is annoying with their res.json() and text()
@pale vessel because you can't check the body beforehand right
right
is there a property for that?
i'm guessing there is
but i don't use it anymore
i use the built-in http(s) request now
Ignoring exception in command unblacklist:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 83, in wrapped
ret = await coro(*args, **kwargs)
File "OwO.py", line 235, in unblacklist
await ctx.send(embed=embed)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/abc.py", line 870, in send
data = await state.http.send_message(channel.id, content, tts=tts, embed=embed, nonce=nonce)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/http.py", line 225, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embed.fields.0.name: This field is required
The above exception was the direct cause of the following exception:```
does this mean the embed has to have a name ?
Guys
Before that, my bot had an error 429, it passed in Β± 5 days, but now it appears again, although nothing was touched
@earnest phoenix http post
@clever dust you need an HTTP client like phin to send HTTP POST requests to a URL
The request body will be whatever data is sent in the POST request
example of phin:
const phin = require("phin");
phin({
url: "https://www.example.com",
method: "POST",
data: {
smth: "smth"
}
});
read more about phin at https://npm.im/phin
So, what i need to do, if I want this not to happen again
use proxies
How? Rly idk
Google yep?
yep
@silent cloud send the request stuff to the proxy, the proxy forwards on the request to the API and since the proxy's IP is different from your main bot if the proxy gets rate limited you can switch to another while one of them is rate limited

ytdl has an example for using a proxy in their github

and also not allowed in some APIs
ytdl has an example for using a proxy in their github
@quartz kindle rly!?!?
Hmmm how
most free proxies either are super slow, not secure or they collect and sell your info
that's why they are free :P
or they get shut down fast
not to mention their uptime
Is there any difference between a proxy and a normal web server other than only being used for rerouting requests
damn, it was mentioned, gg
also free proxies are blocked from most apis/sites
Why do you guys always suggest stuff to people then instantly ruin their excitement five seconds later
I don't think free proxies are that much shit for smol devs like us
@silent cloud try out a free proxy for testing then when you're confident rent a real proxy for the real bot
Ohhh thats money
i've tried free proxies and none of them worked :p
Lol
probably my luck
i can get help pls
i try to install quick.db
in another pc
but its not download it
can you elaborate on that
hey
could someone help me with this problem:
if(message.author.id !== '345138133429649408') return message.channel.send("You don't have permissions to do that!");
let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
if(!rMember) return message.channel.send(xdemb);
let role = args.join(" ").slice(22);
if(!role) return message.channel.send("Specify a role!");
let gRole = message.guild.roles.find(r => r.name === "name");
if(rMember.roles.has(gRole.id)) return message.channel.send("This user already has that role.");
await(rMember.addRole(gRole.id));
await message.channel.send(`***I just gave ${rMember.user.username} the ${gRole.name} role!***`)
message.delete();
}```
my !addrole isn't working?
it just says nothing
nothing errors out.
is it an invalid user?
sup
hey
is the role actually called "name"?
are you using v11?
it should be roles.cache.find()
and the name should be the role that you're trying to find
my bot is not replying to any commands i have tried many command handler my bot was working well till toady bot today my bot goes offline and i again hosted my bot on heroku but he is still not respomding
can't i put a args in there?
let role = args.join(" ").slice(22);``` can't i put args role in the name?
ye
as i want to add a role by name
treat r as a role
role has the property name
and you're trying to find a role that matches the input
so r.name === something
let role = args.join(" ").slice(22);
if(!role) return message.channel.send("Specify a role!");
let gRole = message.guild.roles.find(Role => Role.name === role);``` owh yeah exactly
why does my bot keep sending more than 1 message?
did you check your version?
bin it
don't mind the mess as notpad messes it up
@west agate bin it.
wut?
Invalid user you can help me or not
provide something
ask your question lmao.
like the error
I say I try to install
you can't say "it doesn't work" without a proper reason
Pc
what didn't work, like something
.send("sent by "+ message.author.tag + message.content)
how i can space between sent by and message content ?
Use a ` string
use template literals
@west agate oh god please dont do that
.send(sent by + message.author.tag + message.content)
how i can space between sent by and message content ?
right ?
Use template literals.
ok
I have literally said.
anyone that could help me out?
thank u
@west agate first, dont do multiple let , second, dont do multiple setField(), theres setFields() method so you dont repeat that.
let xdemb = new Discord.RichEmbed()
.setColor("#00ff00")
.setTitle(`Addrole command`)
.addField("Description:", "Add role to member", true)
.addField("Usage", "!addrole [user] [role]", true)
.addField("Example", "!addrole @Odar Member")
if(message.author.id !== '345138133429649408') return message.channel.send("You don't have permissions to do that!");
let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]);
if(!rMember) return message.channel.send(xdemb);
let role = args.join(" ").slice(22);
if(!role) return message.channel.send("Specify a role!");
let gRole = message.guild.roles.cache.find(r => r.name === role);
if(rMember.roles.has(gRole.id)) return message.channel.send("This user already has that role.");
await(rMember.addRole(gRole.id));
await message.channel.send(`***I just gave ${rMember.user.username} the ${gRole.name} role!***`)
message.delete();
}```
why is my !adddrole command not working?
third, all of that is in data already
no need to reference those values into other variables
@eternal osprey are you fucking telling me you have the exclamation mark as the prefix 
Await
i just use it like that in my test server
Isnβt
HELP ALERT
A
await() is allowed
Ok
wait what?
ignore me?
ignore me
ReferenceError: me is not defined
oowh.
Why not args[1] instead of some weird split join rubbish
i
i
@cobalt spruce you?
YES
my zqsd wasnt working
@eternal osprey can you add console.log(role) and console.log(gRole) after defining gRole?
okay sure.
i made (copyied) the help command from https://discordjs.guide/command-handling/adding-features.html#a-dynamic-help-command
and i want to make it as embed
but am suc
so i need to ask
it use data push that i dont know how to use in Embed
Grizz Got ignored
@low shard did you install build tools?
hes missing python
you can specify python path via command right?
or he should probably install it if he haven't already
node guy gets run by node itself so you have no control over the args
gyp*
node gyp*
npm config set python won't do?
idk about config
node guy
back... with a full stomach
let reason = 'Unspecified';
if (args[2]) reason = args.splice(3).join(" ");
try {
const embed2 = new Discord.MessageEmbed()
.setTitle("TEMPBANNED")
.addField("Read!", `${user} you have been **Tempbanned** for ${time} day(s) in the server "**${message.guild.name}**" by ${message.author} with the reason of \`${reason}\``)
.setFooter("Time tempbanned", message.guild.iconURL())
.setTimestamp()
.setColor(0xf7ff31)
user.send(embed2)
} catch (err){
console.log(err)
}
Why dows Unspecified not show up?
hey i have logged my role and grole
gang
all i get
so my gRole is notworking for some reason/
async def timer(ctx, seconds):
try:
secondint = int(seconds)
if secondint > 300:
await ctx.send("I don't think I can go over 5 mins.")
raise BaseException
if secondint <= 0:
await ctx.send("I don't think I can do negatives")
raise BaseException
message = await ctx.send(f"Timer: {seconds}")
while True:
secondint -= 1
if secondint == 0:
await message.edit(content="Ended!")
break
await message.edit(content=f"Timer: {secondint}")
await asyncio.sleep(1)
await ctx.send(f"{ctx.author.mention}, Your countdown has been ended!")
except ValueError:
await ctx.send('You must enter a number!')```
I wanna embed this command please help
check your args
you should use args[1] instead of slicing 22 characters of the joined args
wat
@pale vessel help me please
bro chill the fuck out.
@eternal osprey u are the last person to say that
i was talking to Endph.
@autumn aspen with what again
what are you kidding me?
i am asking in a polite way
you are begging like fuck,
@pale vessel
let reason = 'Unspecified';
if (args[2]) reason = args.splice(3).join(" ");
try {
const embed2 = new Discord.MessageEmbed()
.setTitle("TEMPBANNED")
.addField("Read!", `${user} you have been **Tempbanned** for ${time} day(s) in the server "**${message.guild.name}**" by ${message.author} with the reason of \`${reason}\``)
.setFooter("Time tempbanned", message.guild.iconURL())
.setTimestamp()
.setColor(0xf7ff31)
user.send(embed2)
} catch (err){
console.log(err)
}
this
Unspecified dont shows up
;
when I tempban
@earnest phoenix you can use discord.Embed() for embeds
'
@pale vessel for embeding that commands
@pale vessel what you say
who need help with coding
me kinda.
@autumn aspen what did the message show?
@pale vessel it only showed up "``" not the Uncpesified
just dm and i will help u with coding
bruh dm help
have you tried debugging?
@pale vessel I will show u in hb
why not here?
@autumn aspen debug
he said debug
@pale vessel you can help me or not
you should log reason and see that it is
you should log
reasonand see that it is
@pale vessel aight
not a testing channel
@low shard constantin can probably help you, i don't have that much experience with these native module errors
btw invalid user
the slice.(22)
is for removing the member id
as you are pinging.
can't you use args[1]
no
why not
gang gang
so @member (role name)
well it came back to me like this: @!745253908275920986> gang
let role = args.join(" ").slice(22);```
and i am
22?d
try console.log(args)
anyways this works
but pings can be different
the variable role works
it is the gRole
@autumn aspen next error will be a missing ;
...
.setColor(0xf7ff31); <--
user.send(embed2); <--```
well, let's get to that then
as it's not logging.
let gRole = message.guild.roles.cache.find(r => r.name === role);```
so the role matches the role name that you want to look for?
exactly.
does it have any whitespace?
the input
wait a minute,
you can use string.trim() just in case
there would be a space
since you're only slicing the mention length, excluding the space
add .trim() to role
let role = args.join(" ").slice(22).trim();
What does trim() do?
trim an amount of characters right?
@eternal osprey
what's up
Oh, good.
like " test " becomes "test"
i made (copyied) the help command from https://discordjs.guide/command-handling/adding-features.html#a-dynamic-help-command
and i want to make it as embed
can any one help
notagirl dm u @eternal osprey
yeah she did
why
she said shes testing out the code i provided,
but imo she's just doing something?
@cobalt spruce copying is NOT making
she said it's an illegal return statement..

uhhm wtf.
The fact that you canβt apply it to an embed means you donβt understand the code.
@eternal osprey
WHAT
@misty sigil ik
almost 12am here so i gotta go to bed, gtg
b
have a great night!
@autumn aspen next error will be a missing
;... .setColor(0xf7ff31); <-- user.send(embed2); <--```
@boreal iron lmao everything works as it should that thing with uncpesified was only the problem but I fixed it
i hope os!
what u got ; this from
lol
_just to have a "correct" syntax
@boreal iron oh yeah
but I will fix it or that is the last thing
bc I need to hurry if my bot is gonna get approved by top.gg
@boreal iron
--bots
-bots
what does it do?
what does it do?
@boreal iron its a professional project that can lock channels servers better than sounddrouts bot (private)
I need it to be as good as probot
and much better
than it
roger
lol
if(message.author.id !== '345138133429649408') return message.channel.send("You don't have premmsions to do that!");
let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]);
if(!rMember) return message.channel.send(xdemb);
let role = args.join(" ").slice(22).trim();
console.log(role)
if(!role) return message.channel.send("Specify a role!");
let gRole = message.guild.roles.cache.find(r => r.name === role);
console.log(gRole)
if(!gRole) return message.channel.send("Couldn't find that role.");
if(rMember.roles.has(gRole.id)) return message.channel.send("This user already have that role.");
await(rMember.addRole(gRole.id));
await message.channel.send(`***I just gave ${rMember.user.username} the ${gRole.name} role!***`)
message.delete();``` why is this still not working?
it is only logging the role
and not the gRole
if(message.author.id !== '345138133429649408') return message.channel.send("You don't have premmsions to do that!");
let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]);
if(!rMember) return message.channel.send(xdemb);
let role = args.join(" ").slice(22).trim();
console.log(role)
if(!role) return message.channel.send("Specify a role!");
let gRole = message.guild.roles.cache.find(r => r.name === role);
console.log(gRole)
if(!gRole) return message.channel.send("Couldn't find that role.");
if(rMember.roles.has(gRole.id)) return message.channel.send("This user already have that role.");
await(rMember.addRole(gRole.id));
await message.channel.send(`***I just gave ${rMember.user.username} the ${gRole.name} role!***`)
message.delete();``` why is this still not working?
@eternal osprey wtf is xdemb
-bots
it's something i defined.
whats the issue again?
Notagirl says its because it's an illegal return statement.
i mean, how.
this isn't an illegal return statement, is it?
it's something i defined.
@eternal osprey I think copy persons is not that good
this isn't an illegal return statement, is it?
@eternal osprey google it
@autumn aspen what are you saying amte?
i didn't copy anything
i made it myself.
dude I have been here for 6weeks and Im better than u
do you even know what defining is?
@autumn aspen how did u add colors to ur messages
the script ones
Hi mother fuckers
@earnest phoenix @modern sable
awsome
yeah
check ur dm
@autumn aspen how did u add colors to ur messages
@cobalt spruce just type '''js but the other once
like other dots
hey
like that
but js
and code
js```js
const { prefix } = require('../config.json');
const Discord = require('discord.js');
module.exports = {
name: 'help',
description: 'List all of my commands or info about a specific command.',
aliases: ['commands'],
usage: '[command name]',
cooldown: 5,
execute(message, args) {
const data = [];
const { commands } = message.client;
if (!args.length) {
data.push('Here\'s a list of all my commands:');
data.push(commands.map(command => command.name).join(', '));
data.push(`\nYou can send \`${prefix}help [command name]\` to get info on a specific command!`);
return message.author.send(data, { split: true })
.then(() => {
if (message.channel.type === 'dm') return;
message.reply('I\'ve sent you a DM with all my commands!');
})
.catch(error => {
console.error(`Could not send help DM to ${message.author.tag}.\n`, error);
message.reply('it seems like I can\'t DM you!');
});
}
const name = args[0].toLowerCase();
const 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 });
},
};```js
dude I just told u
can any one help me make this as a embed
@cobalt spruce look
var thatsHowitWorks;
@autumn aspen were
js has to be in the first line
to specify javascript
meant the code tag in Discord (here)
@clever dust you need an HTTP client like phin to send HTTP POST requests to a URL
The request body will be whatever data is sent in the POST request
example of phin:const phin = require("phin"); phin({ url: "https://www.example.com", method: "POST", data: { smth: "smth" } });read more about phin at https://npm.im/phin
@earnest phoenix thanks, it works
const { prefix } = require('../config.json');
const Discord = require('discord.js');
module.exports = {
name: 'help',
description: 'List all of my commands or info about a specific command.',
aliases: ['commands'],
usage: '[command name]',
cooldown: 5,
execute(message, args) {
const data = [];
const { commands } = message.client;
if (!args.length) {
data.push('Here\'s a list of all my commands:');
data.push(commands.map(command => command.name).join(', '));
data.push(`\nYou can send \`${prefix}help [command name]\` to get info on a specific command!`);
return message.author.send(data, { split: true })
.then(() => {
if (message.channel.type === 'dm') return;
message.reply('I\'ve sent you a DM with all my commands!');
})
.catch(error => {
console.error(`Could not send help DM to ${message.author.tag}.\n`, error);
message.reply('it seems like I can\'t DM you!');
});
}
const name = args[0].toLowerCase();
const 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 });
},
};```
i want to make this as a embed
any one can help?
exactly!
data is the array
@boreal iron i copied the code
.push() will add a new field to the array
from the guid
you gonna use the callback to send EmbedMessages and use for/foreach for each data field, for example as embed field
for(var i = 0; i < data.length; i++ )
for example
@eternal osprey check dms
@boreal iron i toltaly understand what u sayingπ
embed -> fields need at least a name and value
i wana die
each element of data will get an embed field, for example
1 field = 1 line to list all contents of array data
however you like to do it
@eternal osprey
can't help you will all the callbacks and functions in DiscordJS, not using it
I'm sure there should be an example how to create embed messages using DiscordJS
lets dislike his vids
that editing cringe ngl
@sudden tinsel #rules-and-info
Adib i saw that quick edit π
const embed = new MessageEmbed()
// Set the title of the field
.setTitle('A slick little embed')
// Set the color of the embed
.setColor(0xff0000)
// Set the main content of the embed
.setDescription('Hello, this is a slick embed!');
// Send the embed to the same channel as the message
message.channel.send(embed);
.addFields(
{ name: 'Regular field title', value: 'Some value here' },
{ name: '\u200B', value: '\u200B' },
{ name: 'Inline field title', value: 'Some value here', inline: true },
{ name: 'Inline field title', value: 'Some value here', inline: true },
)
@cobalt spruce .addFields to add your fields from the array data into
@boreal iron man am dum
how do i see what item the person uses and then with id's do what its suppose to do through id
discord.py, if you dont understand anything tell me what u dont understand ill try to explain : >
@boreal iron cant u just send source code in my dms
lol
dont get me wrong, learning to code doesn't work if somebody presents you the solution
how do i see what item the person uses and then with id's do what its suppose to do through id
discord.py, if you dont understand anything tell me what u dont understand ill try to explain : >
@boreal iron man help me more
could anyone please help me with my not working role addcommand?
if(message.author.id !== '345138133429649408') return message.channel.send("You don't have premmsions to do that!");
let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]);
if(!rMember) return message.channel.send(xdemb);
let role = args.join(" ").slice(22).trim();
console.log(role.length)
if(!role) return message.channel.send("Specify a role!");
let gRole = message.guild.roles.cache.find(r => r.name === role);
console.log(gRole)
if(!gRole) return message.channel.send("Couldn't find that role.");
if(rMember.roles.has(gRole.id)) return message.channel.send("This user already have that role.");
await(rMember.addRole(gRole.id));
await message.channel.send(`***I just gave ${rMember.user.username} the ${gRole.name} role!***`)
message.delete();
}```
it isn't adding shit.
hey quick question, how could I check if a role was mentioned in a message?
or a member with that role
is what I meant sorry
@eternal osprey u use python?
what's the issue with ur code?
nope, Awsome in this case
ok


