#development
1 messages · Page 440 of 1
--ignore-watch
@solid cliff and then the path or just the foldername?
And how to run multiple
https://stackoverflow.com/questions/38070869/expressjs-pm2-ignore-watch-public-images-folder
I dunno how to pm2 👀
I did that, didnt worked
i autorestart my bot by running it in a loop
Guys, noobish question but does the detailed description for a bot need to be in coded HTML or can it just be raw text
it can be raw text
Ah good, I look into it being more fun later on
chose md/markdown from the drop down menu, so you can have all the text styling features discord has
like * and `
Yea
Oops! Error: 401 Unauthorized
why do i get that error when trying to connect my bot to the api?
that should go in #topgg-api btw
ops
Depends.. what are you trying to use
ok i have the request headers
Ah nvm
i have the headers from the browser im trying to find out where they are in the code
on the request side
Sort of the same as getting the response.. if i wasnt at work.. id tell u lpl
dbl api? #topgg-api
is this theright way to set the content headers on an http request in c#?
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=ja&dt=t&q=test");
request.Content = new StringContent("",Encoding.UTF8,
"application/json");//CONTENT-TYPE header
HttpResponseMessage response = await _client.SendAsync(request);```
my string format is empty but it returns the same as before
There is a lot of ways.. i think there is am actual method for it tho.. add...Header
Default maybe?
And commenting that its the content-type, doesnt make the webpage know what it is :)
Guys, what’s shards for?
Think of it like this
Every time an event happens Discord sents it to all clients that can read it
But when you are in a lot of guilds that pipe gets a bit clogged
So you just add more pipes
Yeah
If you use discord.py or discord.js or Eris they have great sharding support
They support something called internal sharding
Ah, I’ll look into that
Basicly that means getting all the smaller pipes and converging into 1 big pipe again
Nice
hi
Thanks for telling me
No problem
if you are using discord py if you are using commands.Bot(some parameters) change the Bot part to AutoShardingBot
Yeah that's the internal sharding I mentioned
Also, if your bot serves more than 2500 servers, you will be legally required to shard it by penalty of law.
Jk, your bot just won’t be able to log on
On another note, do you know what happens when you are running on 1 shard and your bot doesn't go down, and you break the 2500 limit
I figure you just don't receive events for everything past the 1st shard
Or would it just work until you restart?
Oh. Yeah, work with @solemn valve add the same headers as your browser sends, and try again
Header will be "name":"value
Not like the discord api is stable enough to never let your stuff go down but hypothetically
i think it will crash
@quasi marsh I would assume some measure would be in place that would shut off your bot, since in d.js, your client is integral to every call it receives
"Content-Type", "application/json" etc
In a similar manner to if you reset your token while your bot is runing
Hmm that's a possibility
yeah
@quasi marsh Internal Sharding has a big disadvantage
Yeah it's single threaded
yup
tbh when I'm gonna write v3 my bot is going to be nothing more than a shell for my platform
But that depends on when the internal sharding has issues
can fs see hidden files?
Kinda wonder if Danny is experienced enough with Python to write a multi-process autosharder
That would be wicked
gj
definetely broken
Deleting Bot messages after the command message has been deleted in discord.py (rewrite)?
sorry, idk what to do about that
but you can ask the discord.py support server
So I put in this code for my game status, await Client.SetGameAsync("Type /AJ/help | " + Client.Guilds + " servers!"); but this comes up on the playing status, idk why
Client.Guilds.size
ok
What language is that?
c#
because you need to calculate the length of it
@simple bramble <client>.Guilds.Count
hot
len(client.guilds)
i got it to work
ok
code?
entire command or how i'm getting the role?
how your getting the role
let role = msg.mentions.roles.first() || msg.guild.roles.get(args[0]) || msg.guild.roles.find(ro => ro.name.includes(args.join(' ')));
if (!role) { role = msg.member.highestRole || 'n/a'; }
if (role === 'n/a' || !role) return msg.reply('I couldn\'t find a role with the provided arguments.');
won't msg.mentions.roles.first() always succeed in finding the first role of the server?
Not a JS expert btw
yes it will

it should all be stept
wouldn't it get first mentioned role?
check args first
then check highest member role, if not found check the first role in the server that's not everyone
kind of fixed it, alright though
also can you mention a role like this in an embed title?
no
alright
yeah, got it. ruins that idea in my head, thanks though 😄
you can omit title and do it in description
What you could do is set the embed color to the role color
already am
one other question, what are the permissions that allow you to join/speak in vcs, and the add reaction one?
ADD_REACTIONS for the reactions one
USE_EXTERNAL_EMOJIS if you want to react with non-default emojis that are not present in the reacting server
CONNECT to join vcs SPEAK to speak xD
alright
thanks
ermm 👀
await mute(msg.guild, msg.member, user, reason); thats where its erroring
uhm what's mute
it doesn't error there but within, also UnhandledPromiseRejection is a promised function erroring that is not awaited / catched
so the error is coming from inside that func, you're trying to resolve a role but the supplied parameter is unresolvable :p if you show more code / context we can help you more
dunno why thats happening tbh but its gone now
though it still won't send to the mod log channel
mute: async (guild, moderator, user, reason) => {
let { modlog, caseId } = await r.table('guilds').get(guild.id);
if (!modlog || !caseId) return;
if (modlog === 'disabled') return;
let channel = await guild.channels.get(modlog);
if (!channel) return;
caseId++
const modCase = new RichEmbed()
.setColor('#E1C15C')
.setAuthor(`${user.tag} muted (case #${caseId})`, user.displayAvatarURL)
.addField('User', `${user.tag}`, true)
.addField('Moderator', `${moderator.user.tag}`, true)
.addField('Reason', `${reason || 'No reason provided.'}`, true)
.setTimestamp()
channel.send({ embed: modCase }).catch((err) => { return; });
await r.table('guilds').get(guild.id).update({ caseId: caseId });
},
thats the code it uses to get the mod log channel and send it
but it never sends, and it doesn't error
looks fine, try logging all the steps to see if there isnt anything broken
is modlog a snowflake at the point you retrieve the channel?
modlog should be the channel id there
but the error was expecting either a role or a snowflake, so something related to roles
he said the error is gone, it just won't send message now
well you could catch(console.error) instead of sending it to the void
maybe send errors but you never know because of that catch there xD
fixed that up, turns out it was something really stupid lol
modlog was actually set as undefined in the db
lol
how do you set an auth token thing in snekfetch? this api says to do this:
..but i dunno how to do it with snekfetch
people pls help me
ask. your. question.
Pretty self-explanatory, you have a memory leak.
You still need one .on('message', ...
i don't know much about d.js but there's a lot of command handlers out there
eh true
yeah create a simple handler that redirects names to functions
i'll just say that command handlers will make the bot code much more simpler
yeah i just took a look at the code
that's WAY TOO MANY handlers
how do I understand I have to create a separate js file for the commands?
if you don't want to use a command handler at least don't use a handler for each command
ok thx
like
azart.on('message',(message) => {
if(message.content == "///roll"){
if(getRandomInRange(1, 10) == "9")
message.reply("You fell :nine:");
}
});
azart.on('message',(message) => {
if(message.content == "///roll"){
if(getRandomInRange(1, 10) == "10")
message.reply("You fell :keycap_ten:");
}
});
could be
azart.on('message', (message) => {
if (message.content == '///roll') {
if (getRandomInRange(1, 10) === 10) {
message.reply('you got :keycap_ten:')
} else if (getRandomInRange(1, 10) === 9) {
message.reply('you got :nine:')
} // etc, etc
})
waow, I wouldn't have thought of that, thank you very much. 😃
np
anyone know about my question?
Can someone help me? I have a question about Heroku, hosting my js bot
Plz ping me if you can help
just ask the question smh
ok
in my bot it creates a file ( "(Servername) | (Server ID).json" ) for settings like a custom prefix,...
When I host my bot on Heroku it creates the file when I invite the bot to my server, but when it restarts, the file doesn't exist anymore for heroku/the bot.
So then I need to reinvite my bot again so it can create the file, but when my bot goes public, I can't make it so for every update I do, every owner needs to reinvite the bot
use a database, json is also dangerous for public bots
ok thx
In SQLite3, should I use cursor.close() and connector.close() in my function after commiting my changes?
@slender thistle i remember when i used SQLite i didn't have to use any of that
do you mind elaborating or something
then again that was like 9 months ago when i had no idea what i was doing
thats still me
ok, so im rewriting my bot economy and im wondering if i should just add them to the database when any command is ran or just make an create account type command
enmap isnt a db
um im using sqlite
not u
@earnest phoenix it's a binary database if using persistence.
Okay whatever you say.
then what's nosql? 
@merry stirrup idk if someone told you yet but you cant creat or edit files with heroku
unless you buy a plan with a database
did snekfetch v4.* feature any breaking changes over 3.6? i can't make a simple get request that would usually work in 3.6 on >4.0
just returns unexpected token u in JSON at position 0
check the lib
show code
i've checked but can't seem to find much
(node:1434) UnhandledPromiseRejectionWarning: DiscordAPIError
at item.request.gen.end (/rbd/pnpm-volume/cf191059-75c8-4859-ac1b-4aca702197aa/node_modules/.registry.npmjs.org/discord.js/11.3.2/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:71:65)
at then (/rbd/pnpm-volume/cf191059-75c8-4859-ac1b-4aca702197aa/node_modules/.registry.npmjs.org/snekfetch/3.6.4/node_modules/snekfetch/src/index.js:215:21)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:1434) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:1434) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I get this error, but it gives not what the reason is. Does someone know what's wrong?
and what version of v4
snekfetch.get("https://nekos.life/api/v2/img/neko")
.set("Accept", "application/json")
.then(res => {
mes.edit(`${client.util.emoji("ok", message.guild)} Here's your neko!\n${JSON.parse(res.text).url}`)
})
don't bag me for using a neko command as code it's just the simplest 
@past pike DiscordAPIError
this code works on 3.6 (right now) but not on 4
yeah i know, but normally it gives why but now it doesn't
@past pike are you on master
use res.body
i've heard master has been having issues
res.body.url
I use Glitch.com
i didnt know JSON was text
bc text isnt the same
and you should be using res.body
res.body is parsed data
text is probably added
oh so i dont need to parse it
yw
hey jon if you'r free can you tell me how to check permissons of the @everyone role in a secifique channel
I know what the problem is. My bot gets new token every minute. How to stop that?
oh nice
does snekfetch default set the content-type to application/json?
thats some UFO sh*t right there
I didn't think it did
probebly cus you'r changing them
he might have it in the headers
it checks what the response's content-type is then parses it
ah okay
i tryed .permissionOverwrites but it give all the roles in the channel and i couldn't specificate it to one role
well yeah
He may have looked at code too
but you don't like how it has dependencies or whatever
Gus's code flows pretty well
i think u mean superagent
lol Blake boi
isn't d.js switching from snekfetch to superagent though
to node-fetch
i dont remember what they were switching to but i know they're ditching snekfetch
and they already have
idk why they would 
yeah
but i cant stand node-fetch
i can't either
Snek is smart af
i thought snekfetch was good
mainly bc it forces you to nest promises
but apparently it was bugged or something
but snekfetch seems to die in some websites
thats fixed in v4.0.4
I've seen some breaking issues when updating on occasion
i need to update then
i've been trying to get a picture from a website but keep getting 404 error
also the update command is npm i snekfetch ?
no
give yarn a try
When i use my command prompt to start my bot, then it starts but on the website where it hosts says DiscordAPIErrror, so I don't know what the problem is. Someone knows how to fix it?
isn't the token missing ??
@austere meadow if u want a fetchURL method like me i suggest doing ```js
return new Snekfetch(method, url, options).then(res => res.body)
.catch(error => {
Error.captureStackTrace(error);
throw error;
})
so its any method
You should be able to do npm update
whats the command to update a lib ??
ah okay
where do you put the fetchURL method
do you store it in the client or in a structure
what does npm outdated look like for you?
is options

const snekfetch = require('snekfetch')
const Discord = require('discord.js')
const bot = message.client
snekfetch.get('http://aws.random.cat/meow')
.then((res) => {
const embed = new Discord.RichEmbed()
.setTitle(`Some random cute cats`)
.setColor('RANDOM')
.setImage(res.body.file)
.setTimestamp()
.setFooter('Requested At:', bot.user.displayAvatarURL)
message.channel.send(embed)
})
is it cus of my code or what??
tfw i dont even use random.cat
so its cause of those 2m requests
i gave up on them
weeb?
i use some other random api nobody has heard about
http://thecatapi.com/api/images/get
i should go for weebsh tbh
i didn't know weebsh had that
i just thought it has nekos
they also have dogs
https://nekos.life/api/v2/img/meow
hi, i'm making a bot and i'd like it to have it's own custom emojis. Do you know if it's something possible?
neko.js?
but it has some lolis in it is that allowed in bot lists?
yes
it also has an api
yes
XD
i wrote neko.js
it contains some lolis are they allowed ?
its a big joke
yeah
¯_(ツ)_/¯
I haven't touched it since i made it
You've improved a shitload so I wouldn't worry about it lol
only to update deps
I think he has new endpoints now though
I just have a json file with the endpoints and let the js file generate the functions
probs what im gonna do
speaking of which, I think someone PRed a change in the json and idk if I updated it yet

lol rip
for (const endpoint of endpoints) {
Object.defineProperty(Client, {
value: function() { return get(endpoint) }
});
}```
kthxs bai
no answered my question..... 😢
@acoustic olive I doubt lolis are disallowed unless it's 18+.
Oh, I am reading the wrong thing.
message.channel.overwritePermissions(message.guild.id, {
SEND_MESSAGES: false
})
message.channel.send(embed)
setTimeout(function () { //so this code dont excute if the unlock command was triggered
message.channel.overwritePermissions(message.guild.id, {
SEND_MESSAGES: null
})
message.channel.send('Lockdown Lifted')
}, ms(time))
If it's not Python, I can't help, sorry. ¯_(ツ)_/¯
rip
Youre checking a guild id though?
Anyone above the everyone role will still be able to talk
yes
if they have the permission to send messages then yes
i dont have enought time to code something that allows the mods to select the specifique roles that must be muted
Hello guys! Idk why but I am suddenly getting this error overnight....
node:2010) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError
(node:2010) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I don't quite understand the error....
Did you read the error?
Yes, but I don't understand it
The error is unhandled.. so you will need to .catch() it to make it "handled"
Without knowing your code, youd have to figure out which promise youre sending that is unhandled
Hmmmm
I do have a bunch of trys already...
I really don't think it's my code since it was running fine yesterday until this morning npm auto updated it's packages
Valuable lesson. Just copy paste the error into google. Specify the language.. JS
That would make you assume something changed in one of your libs that requires error handling
Should*
I need help on making my bot's auto-response to not work here. But work in other servers where it's allowed
An if statement.
when i try to enter the command, like ask Hello! It should say "Hello!" in the embed, but it gives me a "message not found" error. idk how to fix this
I have a question.
what is it 
what is the error
what are the logs above
install python 2.7
I dont use python
Opus needs python.
People can use javascript for the bot, but Opus itself uses python.
You only need python installed.
Than how can you use Opus with Javascript with Python Needed?
Python is installed on my laptop anyway
Just install python and you are good.
I have?
Then for some reason Opus can't find the executable. 
What Python do I need?
Pretty sure it uses python 3.5.
Would use latest one.
The one that was just made yesterday
was
3.6.6
Gzipped source tarball
Source release
9a080a86e1a8d85e45eee4b1cd0a18a2
22930752
SIG
XZ compressed source tarball
Source release
c3f30a0aff425dda77d19e02f420d6ba
17156744
SIG
macOS 64-bit/32-bit installer
Mac OS X
for Mac OS X 10.6 and later
c58267cab96f6d291d332a2b163edd33
28060853
SIG
macOS 64-bit installer
Mac OS X
for OS X 10.9 and later
3ad13cc51c488182ed21a50050a38ba7
26954940
SIG
Windows help file
Windows
e01b52e24494611121b4a866932b4123
8139973
SIG
Windows x86-64 embeddable zip file
Windows
for AMD64/EM64T/x64
7148ec14edfdc13f42e06a14d617c921
7186734
SIG
Windows x86-64 executable installer
Windows
for AMD64/EM64T/x64
767db14ed07b245e24e10785f9d28e29
31930528
SIG
Windows x86-64 web-based installer
Windows
for AMD64/EM64T/x64
f30be4659721a0ef68e29cae099fed6f
1319992
SIG
Windows x86 embeddable zip file
Windows
b4c424de065bad238c71359f3cd71ef2
6401894
SIG
Windows x86 executable installer
Windows
467161f1e894254096f9a69e2db3302c
30878752
SIG
Windows x86 web-based installer
Which?
Uhh
@gilded blaze
Can you choose what one I need
Uhh i'm not really sure.
I use Windows
Its installed
should I retry?
I will
oh nvm
its installing still
I changed the name of my bot. I took it down off of the listing website and re submitted it hoping it would reflect the name change, but to no avail. Can someone help?
What library
discord.py rewrite
did the name chnage on discord..?
@vocal raft to update name on the list you just need to edit & save the bit
On the invite page, yes. But in Discord, no
bot*
no need to delete it
also to update the username you need to use your library
updating application name doesn't work
ahhhhhh
what this ask command is supposed to do is that you are supposed to do something like ask Hello! and it will say hello (or whatever you wrote after "ask") in the embed, bit in the console it gives an error with "message not found" idk why
omg.............................................................................................................................................................................
Why isnt node-opus not working
PYTHON in installed
what version did you install
3.6.6
not python, nodeopus
it needs v3.5
it needs a certain version then
lol just checking
just install 3.5.0
show your error @real ginkgo
if it says python not installed, check if you installed it with the right env variables
@knotty steeple there can be many reasons for it.
the error would help
the error says he needs python
there 3.5.0
send the exact error @real ginkgo
python always adds itself to env variables @earnest phoenix
not necessarily
No.
unless you uncheck the option
or if you install it manually
in the installer
Um..
what
send the error while installing node-opus
hm
Would Python not being added to PATH matter?
yes
yea
yes add it to path
Install latest python. Add it to the path and opus should be able to detect.
^
did it work?
@slender thistle node-gyp requires python
did you install node-gyp correctly
to check if it is in env
K
@earnest phoenix installed node-gyp
but when I do npm i node-opus
still wont work
what the error
Yes..
open cmd or powershell as admin
cd your bot source folder
npm install --global --production windows-build-tools
wait for it to be done then
npm --add-python-to-path='true' --debug install --global windows-build-tools
then
npm i node-opus
hes on linux afaik
Im on a windows
oh ;p
lol yes
Do that on windows
nobody speak i need it
are u installing node-opus on windows 
yes
have fun with node-gyp
if you want to install it just do what i said 😛
it took me like 5 tries to install it using the long method
It wont run
use the long way then, which is method 2
hello, sorry to bother you guys again, but i am suddenly getting this error:
UnhandledPromiseRejectionWarning: Error: An invalid token was provided.
It was working correctly earlier (for about 3 weeks). I even regenerated my token, but it is not working still. What can I do to fix this?
build tools takes a while
You have to run as admin
Then your not doing it right if you cant go in the folder
must not be the path then 🤷
try it with quotes
k
if you are doing spaces in directories it needs to be in quotes when u cd into it
wdym quotes
cd "C:\your\path\with space"
Rock is it right token? and not client id your inputting?
yes i am positive its token since it clearly states token next to it on the discord page
Did you try with a test bot to see if your code is right?
hmm no, ill give that a go
Like make another app and use its token
If that still doesnt work theres something wrong with your code most likely
forester when running you right click and run as admin
just be patient doing it
it will just be done and go back in as normal for you to do the next one
Like C:\whatever>
installed python 2.7
POWESHELL
went..
Uhh
oKAY HOPEFULLY
this will work
Okay so..
okay i tried creating a new app, with no functionality other than the ping-pong example, but it still gives the same exact error D:
what you doing it in d.js?
try resetting your token again
he has from my understanding
show me your code but remove the token
token is in a private area so should be good
oki
what did it do?
did it install properly
idk
bruh
like have the + <modulename> thingy at the bottom
Idk
wait up can you calrify
you dont know if what worked
if the module installation
or the node-gyp stuff
all you gotta do is follow the steps
and?
It installed but then I accidentally closed it half way through
I redid the tools thing
and it worked
I did the thing after
and then npm i install node-opus
It just came up with white writing
thats it
can u send a screenshot
I got rid of it

Im dead
can someone tell me a open source antispam?
a good one
not https://github.com/Michael-J-Scofield/discord-anti-spam it often false alarms
you say interval 1000 but it doesnt care
Code:
@bot.command(pass_context=True)
async def quote(ctx, message_id):
message = message_id.content
embed=discord.Embed(title="Quoted message", description=str(message))
await bot.say(embed=embed)```
Error:
Traceback (most recent call last):
File "/home/joshek/.local/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "/home/joshek/.local/lib/python3.5/site-packages/discord/ext/commands/core.py", line 374, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "/home/joshek/.local/lib/python3.5/site-packages/discord/ext/commands/core.py", line 54, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'content'
ctx.message.content is valid.
Does anyone have a bot that uses the imgflip api?
nope
i use giphy's api
and giphypop wrapper
I wanted to check it out but their login was bugged
I keep getting the No texts supplied error even though it has text0 and text1
need help with pm2
I have 2 bots (one mine, one a random guy on this server wich needed a host lol), I want to run both at the same time, also with monitor
So my problem, how to make it restart when it crashes(I think it does that normal), how to make it restart when a *.js was changed
excluded Node_Modules ofc (becasue when i just do --watch, it restarts when my bot edits any file (like a db))
plz tag when you can help
hi
Can anyone direct me to a good tutorial on Python config files?
discord.ext.commands.errors.CommandNotFound: Command "ban" is not found
Anyone have an explanation for that?
command ban is not defined :p
:p
Oh.
also make an error handler
:p
My command is called banuser.
:p
Does someone know a host that has an in build database
i made a bigger mistake :p
How do I make my page look really nice?
while i were making a scy!shoot command i accidentally set sender = sender.convert("RGBA") as sender = shot.convert("RGBA") which made it look like the shot person is shooting itself :p
Heh.
Does someone know a host that has an in build database
Is there an easy way to identify a command caller, or a mention?
But then iT isnt 24:7
discord.Member
24/7
As in *command @user and grab that user's information?
How u host iT 24/7 on your laptop? Do you keep iT open 24/7?
yes
i'm not using databases so that's not a problem for me
even if i were using databases i'd rather save to a file than go with a hosting
mhm
mongoose
lemme see something
What OS are you running?

Can somone help me make a play command
of what kind of game?
Or make it so It will atleast join the voice channel
d.js
what os are you using?
I have python........
node-opus runs with mvc?
?
or only gcc?
on windows people use Visual Studio C++ compiler but on linux gcc works
build-tools install all you need
interesting
I have build-tools
Am I an idiot?
I can't figure out how to use discord.User.
@bot.command()
async def ban(user):
user_id = # get the ID of the user arg
print(str(user_id))
bot.ban(user)
await bot.say("Attempted to ban " + user+".")
i swear i told you how get node-opus 
But you dont even know what it did
why
idk
Then i cant help...
I guess Im lost.
Im dead.
@solar vigil Set the argument as user: discord.Member
what os?
?
Which operating system are you using
@solar vigil first of all: bot.ban doesn't exist and the ban method is in the guild object, second: you have to await it
DOCS: http://discordpy.readthedocs.io/en/rewrite/api.html#discord.Guild.ban
How make mention prefix
Example:
@boreal yacht help
Does anyone would like to host my bot ?
Djs
Use Glitch.com
Okay I'm going to try it
At AnIdiotsGuide is a tutorial
@RaikaS#0178
How make mention prefix
Example:
@boreal yacht help
@solar vigil ```python
async def ban(ctx, user : discord.User):
bot.ban(user)
That's it iirc
Same
How make mention prefix
Example:
@boreal yacht help
depends on lib
discord.js
google it
I found nothinf
it's not that hard? Check if the message starts with a mention of your bot then just set the prefix to that
how are other bots displaying how many servers they're in on the site? I'm using java, jda
@solar vigil Look around before you ask.
We're not here to answer everything.
@wispy roost #312614469819826177
thank you!
All good.
I have looked around.
async def ban(user: discord.Member):
await bot.ban(user)
I'm just trying to execute code if user is not discord.Member.
Uh, when?
Yeah, the code works.
I want to write it to properly handle when someone calls it wrong.
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.exports.run (/home/ubuntu/bot/commands/ROTMGcommands/verify.js:8:21)
at Client.client.on.message (/home/ubuntu/bot/ROTMGindex.js:125:21)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at MessageCreateHandler.handle (/home/ubuntu/bot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/home/ubuntu/bot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65) code: 'MODULE_NOT_FOUND' }
wut?
why do i suddenly get this error?
cuz you dont have request installed
i have
the bot have been running for about 1 month now
and then discord api went down or something and it rebooted and boom this error
il just try to reinstall request
wow it fixed it
wtf is that shit
so on my bot im getting TypeError: member.addRole is not a function
i have this:
const guy = msg.mentions.users.first()
const member = msg.guild.member(guy);
let muterole = msg.guild.roles.find(c => c.name === `${row.muterole}`);
member.addRole(muterole)
Can anyone help me with html on my bot page?
what do you need?
view page source, find the buttons class
inspect element to get their class
and add a style thing
u edit the colors with css
^
How
is it ```
<css>
fhisdjhfsd
</css>
no
<style>
its style
also thats not valid example css lol
but can someone help me with my problem
i console.log member and i do get output
???
is it hex codes?
@knotty steeple isn't it msg.guild.members.get('id') or msg.guild.members.find(m => m.user.username === 'username')?
to get a member
maybe you should learn some css before starting
.class {
background: #000000;
color: #000000;
}```
are u spooning his eye
im not
lol
im teaching css
its css not spoonfeed imo
css is annoying to work with
spoonfeeding is giving them a code to copy paste without them needing to do anything
i dont consider an example that they need to edit as spoonfeeding
each to their own i guess
I don't think this is right
<style>
.button-orange {
background: #000000
}
</style>
does .button-orange exist?
yes
.button-orange isnt even a class on the website
btn-orange?
still dont think thats a thing
what port does glitch run on?
3000 afaik
whats the async task in c#/d.net where if you put in a subcommand as something that would be put in an embed (ex ask Hello!) it will respond in the embed with hello
uhh, i imported my express app to glitch.. but this is what its doing: https://blurp.glitch.me/, why isn't it working?
whats your code
wheres you index.ejs
whats the error
no errors
it just shows the files instead of showing an error (which it should - i left index.ejs out)
it doesnt console.log listening ..
psa: wrap your error handler in a try catch so you don't get errors trying to show your errors
aren't ports supposed to be passed as numbers
yes they are
i think so
@Bunny_Bot.command(pass_context = True)
async def dmperson(ctx, member : discord.Member, *, content: str):
if ctx.message.author.id != 168473188571807746:
return
else:
await user.send(member, content)
you defined member as a parameter, so use that instead of user
yeah I got it
also don't include member
why not?
i mean don't include member in member.send(member, content)
I know
ok
does somebody know how to send a mentions member a dm with your bot?
I tried different ways but can't find it
What library are you using?
discord.js
Sorry mate, ask someone else here.
wdym @past pike
wait a second. I make a script and share it
-_-
send a dm for the person mentioned?
the bot sends me a dm now, but how can he send the mentioned user? (look in the link)
do you know how to get a mentioned user?




