#development
1 messages · Page 505 of 1
ok
and i don't have Website
You can leave it blank
:p
I'm trying to access tid = <Record id=5523>
with id = [t['id'] for t in tid]
but i get
TypeError: int object is not subscriptable```
what am i doing wrong
@inland pulsar its want | Please enter at least 300 characters excluding special characters in your detailed description. Add your commands. Spaces or empty spaces are not counted. |
😦
300 its very big
. ؟
^
Somebody know how to make badges like tatsumaki thing?
a db
Is there a bot that can send a set image from imgur or something with a command?
any bot that has custom commands, like dyno, can be set to send a link
you should refer to their help command and support for that
@sick cloud My code is python if message.author == client.user: return if message.author.bot: return
decent enough?
i guess
mk
^
-bots
@quasi basin
unless selfbot @tawny lava 
smh
@tawny lava Client.user is ignored by default
if you see the above code
i did something useful in my life for once
-bot
-bots
@visual minnow
Yaaa
ty
Is glitch free?
No u
Does somebody know how i can play some webradio over my bot?
just play the stream
Christ, one of my users managed to get a track with the position of 0.9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999998508331853759958651341806936907413232524705693079918621145696333358744322985976339012765021919914439327697679348832779709317454380954939467902767034081583061703747841536243724500959185146712947411710689126987217046917156547882298575993662635399355451540487260146929956932558788332696674270799277414513289630606268534700198369336021642084233462810516357421875
how is that even a valid/safe float
So earlier this morning I was trying to make my bot ban a user with a reason, but the reason would not actually appear in the ban tab, anyone knows how I may fix this?
It doesn't have to be an object
Like this?
@waxen quest yes
For some reason that isn't working
- does your bot have perms
- is the hierarchy correct
- have you tried GuildMember#bannable
Everything except the reason is working
When I am hosting my discord bot on glitch what type of project do I make?
express
ok
Also how do I make a config.js file in my bot code, I am confused on how I do it
google.com/search/?q="learn js" kthx

What's with the quotes in a URL
https://www.google.com/?q=learn+js
that's the way to go
wat timezone is the voting based on?
@earnest phoenix this is better http://bfy.tw/FDsW
For text muting, Dream is right, but for voice muting, it's setMute()
How can I check what the next user message is? (Discord.js)
So they use a command like o/help, and it says please type a section
And for 10 secs, it checks if the message is a valid option, then stops checking
so a message collector
Where can I learn how to make one?
Thanks
https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=awaitMessages would fit your needs better @wide ruin
What is the Discord token format?
I'm trying to auto detect tokens
ok
What's the point of auto detecting tokens anyway?
Because I would like to know if someone leaked their token
So my bot can delete it
Alphanumeric with 59 characters
I wonder how I would detect that in Python (I'm a noob at regex, never actually used it)
Thanks
@earnest phoenix
please eliminate
Dedicated server !== VPS
They are still different
Idk by how much, but a vps costs only a few bucks, and a dedicated server at least $100, depending on how roughly you are using it
Hello, good evening, excuse me You could tell me the command so that my Bot says "Seeing" (and whatever else you put)
What do you mean by "Seeing"?
Something like @earnest phoenix where it says how many guilds the bot is in?
@lean anchor always say what lib whenever you ask a question, also you mean Watching?
How do I make a good bot
@earnest phoenix you code one
How
- Learn a coding language
- Find a lib that is in your desired language
- Code with it
- ????
- Profit
?????
- I don’t have a PC
- I have a school Chromebook that doesn’t do anything
- I only have this phone
- That’s about it
- Oops forgot to expand this
- Bye
Look, I mean this.
How is it a special not
bot*
And WHAT THE HEK IS VIENDO
You have a different language on
Yes
well
It's special because it's a moderator bot specifically designed for this server by the administrators
I have seen this also on other servers
why ask the question then
take this out of #development
I will get my dad to hunt you
@gilded plank: WHY THE HECK U PING!!! STUPIDITY EXISTS AAAAAAAAAAAAA
hmmmm............
this isn't #development related
so post it in #memes-and-media
does anyone else use lavalink for eris?
@earnest phoenix stop sending spammy messages
i cant get it to hook to its express server
wwut
+serverinfo
Yes I know
I don't understand why you would want to do this
Literally a database call on every single message for every user
haha yes
And if you go the caching route, that's a lot of memory your using
if you do per guild prefixes you still have the same db call for every message
That's thousands of users
most users don't even change configs
give me a bot that can spam everyone@
@copper veldt Why do you want a spam bot?
i want to have 1 million pings
I mean yes, I could easily make one in 2 seconds but I will not
do you wanna get banned
load from cache -> if missing load from db and cache -> if needed evict an entry
why ban
because that's against the discord ToS
@copper veldt that is a quick way to get discord banned
this emoji
no like on my own server with no people
yes
still not allowed
you'll still get banned
tos doesnt change based on what server you break it on
whats api ban
not being able to do anything with the api
the ip the bot is in cannot access discord at all
whats api
i've only seen ip bans so far
He could have a dynamic IP address though and then get a new one from his ISP
Should I stop making my bot in commando?
ur opinion
I haven't tried commando, but I don't see much point to it
d.js best
@loud salmon I'm trying to make the ugliest bot page possible and I'm having some difficulty importing in some ugly AF fonts. Are you guys blocking this somehow and do I have to wait until my bot gets approved for the ugly CSS fonts to show up? Thanks!
uhhh
i havent had success importing fonts
i would just use web safe fonts
those work
like........
also im not the one in charge of that
lmao
(though oliy i can manage it i have a resume 4 u)
1st google result
Thank you vilP1l
🤦
good news
comic sans is web safe
ohhh
That's why I asked you guys
my b
maybe you cant change it until its accepted
wait you didnt change it
i dont think @import works
this is what i used when i was fucking with my bot page
@import url('https://fonts.googleapis.com/css?family=Mali');
font-family: 'Mali', cursive;
i can confirm it works
i used it
oh im just a brainlet then
yes

Show me your bot page
i used it on mine
show
me
the
bot
page
oh my gosh
the font works for you
I'll just wait until it gets accepted
what??
im not accepted to anything
*it
??
I'll just wait until my bot get accepted
it shouldn't matter
oh @earnest phoenix i think i know why
try font-family: 'Mali', cursive !important;
ok
I did that already
lol
the !important?
yes
hm
Under body
you need to add , cursive
font-family: 'Mali', cursive !important;
ok
lets try
Nope
didn't work
hm
¯_(ツ)_/¯
Take a look at line 30
One of your commands doesn't have props.help
Huh
All of my commands have exports.help
Take a look at line 30
I dont hv line 30
Your all commands and events are loaded
There might be problems with code
oh
@pastel gull
Hey what does sharding do
Sharding is when you basically run your bot on separate instances so it can handle your bots traffic you need to shard when you reach 2500 guilds
ok
Is there a node library that somehow minifies files before sending them to the users? 
Found this: https://www.npmjs.com/package/node-minify
No idea if it's any good
is php bad for a discord bot? I've only seen it used a few times and everyone says php is too bad for a bot
but like, I think it's gotten faster
I don't use node.js ¯_(ツ)_/¯
i think speed matters a little, right? for the sake of performance on your bot
not something you should really be that concerned about (but you should definitely keep it in mind) until your bot grows large
eg, i keep a few threads to run multiple commands asynchronously because they can make calls to the database
ok
@crude jolt not really
php isnt designed for things beside backend
yes there is js but 
isnt a discord bot a back end application technically

Well, PHP is not an option for bot really
but its not front end either
but it can be used
Yes unless you run it in the client, Juice box
Nothing on PHP lib
https://discordbots.org/search?q=library: Yasmin
I know with JS, you can use a module bundler to run discord.js in the client side
anyone knows how do i know what servers my bot is in?
@earnest phoenix php is an option
Well, OK, an option, I don't mind
the php lib is listed on discord docs not dbl
So what?
you need to make your own map method for this
It doesn't?
Then I'm used to djs collections that extend map
Then you will have to array.from() and map that
Anyone Available to help me with a eval command as I am getting this error: https://hastebin.com/lumirehura.cs
Code: https://hastebin.com/ilawavogol.js
fucking hell
You already declared the variable somehwere..
@knotty steeple js for (const [key, value] of map) { if (value !== 'baguette') { map.set(key, 'baguette') } }
don't need to say it's faster than doing array.from and stuff
?
@slender aspen read the error, it tells you what's wrong
Its saying I have declered Args somewhere else
You declared that variable somewhere above in your code
Yes
So you need to look and see where else you defined it
Im guessing it's here
module.exports.run = async (bot, message, prefix, args) => {
Now a New error:
module.exports.help = {
^^^^^^
^^^^^^
SyntaxError: Unexpected identifier
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
[nodemon] app crashed - waiting for file changes before starting...
Looks like syntax error to me
module.exports.help = {
name: "eval"
}
Highly suggest getting some sort of linter to fix those
Linter?
most scuffed indentation
and code style
Huh
this is why you have to know how to debug your own code
Hastebin is back online
Ik Im learning
u know u can just count
Or use an ide
ok
Use an ide
yes download a massive ide to indent for you
U could use Atom
❌
Fixed and @brazen parcel I have atom
And there are some ide packages that don’t take up much space
use tabs btw
dont mix space and tab
software and websites mess with how many spaces is visually the same width as a tab
so just use tabs
That’s a hastebin error
its faster to move with keyboard in code and easier to stay consistent
no its not an error its just a difference
for ex. in nano is configurable
notepad++ reindent and auto replace space with tabs 🙏
Wait really?
textfx plugin
I’ve never used notepad++ due to its interface
That was most likely me being lazy tho
and takes like 1s to open 
Depends on spec of pc
Although
Mine is pretty good so I might consider getting np++
For collaborative projects, is there a way to share a .vimrc configuration without changing my normal .vimrc?
Or do I need to comment vim rules in each file?
i think there is a local and global one
so you could have 2 accounts 🤷
or a script to swap them
I would recommend vscode/webstorm
vscode >>
yet idfk how to configure node for webstorm
Map.prototype.map = function(fn, thisArg) {
if (thisArg) fn = fn.bind(thisArg);
const arr = new Array(this.size);
let i = 0;
for (const [key, val] of this) arr[i++] = fn(val, key, this);
return arr;
}
``` 
wew this works
intellij ides are amazing since you can use one for all langs
lmao
notepad ++ is a editor
yes
text editor
Yes
no
lmao
vscode is a text editor
why doesnt a map have a map method
@earnest phoenix tonkku won't let me create the bot :(

can you make prefixes "space sensitive" in eris
what i mean it
you can literally do ! ping and it would still respond
in the command client or whatever? probably not
but nobody intentionally does that
and is good for mobile users
and mention prefix
my bot does that
it .trim() everything after prefix
async def on_ready():
invitelinknew = await client.create_invite(destination = channel, xkcd = True, max_uses = 100)
print(invitelinknew)```
this raises a exception channel is not defined
i want that after the bot is ready it prints the server name id and invite link
i have done server and serverid but couldnt do the link
why do you want to create a new invite link every time the bot starts up?
anyway, it would be better to get existing invite links, so you're not constantly creating new ones
How would I find the amount of users that used a command in the last 10 minutes in all of the shards together? ("Active users")
I use a MySQL database if that can help.
@ me please
I figured it out kinda of but it was unoptimized and not sure if it was even right lol
just add something to the database everytime the command is run
well wouldn't that be super unoptimized?
there are many ways to do it, depending how how much information you need, and which timeframes you want to record
I just want to know the amount of users that used a command in the last 5-10 mins
if you need the last 10 minutes only, and never more than that, you can check for timestamps and delete anything that is older than 10 minutes
but Lol it will be expensive to insert a new row for every command that's done
You will also have to check that there is no command from that user in the table
other than that, if you want to save 10-minute time frames, then you need a row for every 10 minutes
you dont need new rows
you can increment a value in a row
but what if a user is using more than 1 command in those 10 minutes?
it will count him multiple times, I dont want that
then you also need to track users
so you want both active users and the amount of times the command was used?
no just the active users
but if a user uses more than one command it shouldnt count him more than once
then create a row for the user, and delete users older than 10 minutes
and check if row already exists before creating
but creating a row for every command will be expensive asf
and checking if the table already has a row of that user
how do I do that 
when you create a table in mysql, you can set the engine used
memory tables are never saved to disk, so all operations should be fast enough

@quartz kindle Works, thanks :D
np :3
Killed my server memory tho 
I don't think there is an optimized solution for this Lol
how much memory did it use?
do you have a lot of data?
was it properly deleting stale data?
just this data
how to remove these? https://furries-are-a.dead-me.me/i/qfpx89a4.png
how much memory did it use? well Idk exactly but my memory is almost capping usually anyways and that really made the bot lag
was it properly deleting stale data? yea
I was looking at the docs, but I can't seem to figure out, how to check if the bot can DM a user, nodeJs.
discord.js?
that shouldnt be happening, so idk
user.send(msg)
@quartz kindle It's fine it was just to see for fun so I did it for 10 minutes and disabled
yes but what permission ? 🤔
@waxen quest it's not sharing a server with the bot/disabled dms from non friends
if i do ;ban it should say you are not aloud to do this
yeah, do you know how do I check if he has that disabled?
@waxen quest try to send the message, catch the error, send message saying I can't dm you
you can't
Good idea, thanks @glacial sentinel and @topaz fjord
thats why you have to make the check yourself
@knotty steeple
If a user has dms disabled it's his fault not mine
I don't bother with that
I changed mine so it send in channel
@knotty steeple https://css-tricks.com/snippets/css/css-box-shadow/
ok yes
you just have to put negative pixels
for what
Anyone using lavaink on an arm computer? Can't get playback to work
Anyone with mongodb knowledge do you know how to delete all dup's except one
if (message.content.toLowerCase() == Prefix + "daily") {
let cooldown = 10000;
let lastDaily = await db.fetch(`lastDaily_${message.author.id}`);
if (lastDaily !== null && cooldown + (Date.now() - lastDaily) > 0) {
let timeObj = ms(cooldown - (Date.now() - lastDaily));
message.channel.send(CooldownErrorMsg1 + ` (**${timeObj.hours} hours** and **${timeObj.minutes} minutes** left)`);
} else {
message.channel.send(BackgroundSuccessMsg5);
userData[message.author.id].Profile_Chests += DailyAmount;
db.set(`lastDaily_${message.author.id}`, Date.now());
};
};```
Anyone knows why this command results in this?
@topaz fjord
@bright spear what is this
@waxen quest cooldown + (Date.now() - lastDaily) > 0 will always be bigger than 0
Thank you
I keep getting this error, does anyone know how I can fix it?
wait for it to spawn shards
so when i try to use that code
thats what happens
but i only want the box under that to get the background color
what hosts
accept paypal credit
@steel drum almost none
Hosts use recurring payments
which can only be done through linked cc/dc accounts iirc
i mean from what i heard you can use paypal to pay for spotify premium
and they do recurring payments
Hey, anyone know how to make custom commands with blarg bot like this: !suspend
License
Canadian
Reason
and it say back in a suspension channel:
BOT:
Suspension: License
Username: Canadian
Reason: Reason
but it's a different thing each time, so it's like input fields or something
I would contact the host in question
the thing is
@inland tinsel ask on their support page
im looking for a host
i dont think
what do u guys use to host
checking
I use webdock
Webdock trades storage for CPU
So basically, they offer less storage but a beastly cpu
I'm on the 50 GB plan, which is enough for my bot
bot.on('messageDelete', message => {
if (!message || !message.id || !message.content || !message.guild || message.author.bot) return;
const channel = message.guild.channels.find("name", "log");
if (!channel) return;
let mdembed = new Discord.RichEmbed()
.setAuthor(`${message.author.tag}`, message.author.avatarURL)
.setColor('RANDOM')
.setDescription(`Deleted the message:\n
`\n"+message.cleanContent+"\n`
`)
.setTimestamp();
channel.send(mdembed);
})
have erroe
error
/app/server.js:101
\n"+message.cleanContent+"\n
^
SyntaxError: Invalid or unexpected token
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
Name of command ?
Sorry im codding too much commands
@earnest phoenix the \n has to be inside the string
bot.on('messageDelete', message => {
if (!message || !message.id || !message.content || !message.guild || message.author.bot) return;
const channel = message.guild.channels.find("name", "log");
if (!channel) return;
let mdembed = new Discord.RichEmbed()
.setAuthor(`${message.author.tag}`, message.author.avatarURL)
.setColor('RANDOM')
.setDescription(`Deleted the message:\n\n${message.cleanContent}\n`)
.setTimestamp();
channel.send(mdembed);
})
now no errors but not work
ia there a channel named log? @earnest phoenix
also using find like that is becoming deprecated
you'll have to use a function
what is
not work
is there a channel named log tho
@earnest phoenix yes i have the channel "log"
you sure you don't have an error
@eternal blaze What library
Discord.py is
async def dm(ctx, user: discord.User):
await user.send("hey")
Yep
Anyone know where RethinkDB dumps are placed in Ubuntu after running sudo rethinkdb dump?
you can do that?
yes with some ez css
display: none; probably
i asked if its allowed
I can see that
Trying to get the first mentioned user in a message. What am I doing wrong? let user = message.mentions.users[0];
ok, what if i need to get the second?
if i need to, ill figure it out. Just trying to get back into js from c#.. but i appreciate the help
!join
how do you color the triangle thing next to tags
because this is very annoying https://furries-are-a.dead-me.me/i/xh30yyph.png
also can you hide the donate button
im gonna do it because its useless for me
It's not against the rules
Only the report, delete, and vote buttons
but who on earth would want to hide the vote button?
@knotty steeple Looks like you managed to the Medal.tv alert
?
client.guilds.size.toLocaleString()} help
guilds is undefined 
how do i define
using JavaScript
are you running that code before the ready event?
you're trying to get guilds size before guilds becomes available
ok
hi
can i get help with my bot
it isnt working..
when i do node to connect it
i did node .
on visual studio but it hasnt been working
and it didnt give me the confirmation message.
bot.on('messageUpdate', message => {
console.log(`עובד`)
//if (!message || !message.id || !message.content || !message.guild || message.author.bot) return;
const channel = message.guild.channels.find(uh => uh.name === "log");
if (!channel) return;
console.log(`עובד 1`)
let mdembed = new Discord.RichEmbed()
.setTitle(`**__הודעה נערכה__**`)
.setAuthor(`עורך ההודעה: ${message.author.tag}`, message.author.avatarURL)
.setColor('RANDOM')
.setDescription(`**ההודעה:**\n${oldMessage}
**ההודעה אחרי עריכה:**\n${newMessage}`)
.setTimestamp();
console.log(`עובד 2`)
channel.send(mdembed)
})
errors in the "oldMessage"
and "newMessage"
oldMessage and newMessage are never defined?
not defined
yes
yes
@jagged plume u can help me?
you need to specify oldMessage and newMessage in the function arguments
u can do that? i dont understand how to do
@earnest phoenix 1. vsc doesn't have a conformation code
- have you tried
node <filename>.js
its in server.js
ok cool
@earnest phoenix what's the error?
a.atag::after {border-left: 10px solid #793a3a}
@knotty steeple if you still need it
does anyone have regex knowledge, and can help me make some regex that turns mentions like @worthy silo to @Username in plain text?
trying to make a cleanMessage function
you cant turn an id into a username with regex
I think he means identifying where the IDs are
@sick cloud if ur using discord.js, there is message.cleanContent that resolves mentions to names
You can try using Glitch.com, it's great to see and learn how the stuff works 🤠
@earnest phoenix
u cant regex an id into a name
oof
@sick cloud like i said u cant turn the ID into a name, but you can use the regex in MessageMentions class https://github.com/discordjs/discord.js/commit/83f2c62c3f383814c32d2cbe6526c06a5e6b1e1f
and replace the mentio nwith the username
/<@!?[0-9]+>/g;
.setTitle( Guild.name + " Information")
^
ReferenceError: Guild is not defined```
Anyone that can help me with this?
discord.js is imported into the project
replace Guild with an actual guild object such as message.guild
oh ok, thank you
Ok Hello
What's the text limit in embedded messages?
Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!
@waxen quest yes i still need it ty
Np 🤠
@bitter sundial are you allowed to remove alerts on bot pages
@earnest phoenix pls
@waxen quest still doesnt change on hover
ok 1 sec
wait got it
yes
#delete
How can i let my bot generate an image and let it send it??
canvas-constructor
thx
though to send it you have to turn the image into a buffer
then send that buffer as an image
okay
discord.js
then you could use canvas or jmp
jimp is slow
It's still an option
but a shit one
I do not know how he works
They both have docs
ok thans you
just pls dont read images from disk every single time they are required lul
remember that guy that did sync fs read on every command 
i nearly died
hes like "thats not the problem im trying to fix something else"
oh
I'm glad they have the sync option for quick shits
but
They should probably hide it so people dont see it
i swear when i google it forst SO answer is always "just use fs.readSync()"
and comments is shitshow of answers from people trllign them why its wrong
and others saying "well its ok in some situations"
and then discord bots devs eat that shit up
they're not wrong, it's okay in some situations
they should go more into detail on what situations tho
wrong situation: reading file on every command 
i think i use it on startup of my bot to load some things but just cos i havent touched that code in forever
i could just wrap the async one in promise
and await that b
I just use fs-promise and await
yeah when u think about it theres not many situations to really use readsync
isnt it only unsafe if ur writing to the same file?
It is unsafe to use fs.write() multiple times on the same file without waiting for the callback. For this scenario, fs.createWriteStream() is recommended.
yea
is there an official discord for eris.js
and if not how do I setup shards with that
its safer in the sense that it halts the bot until the write is complete, so it doesnt risk getting corrupted from another command crashing the bot
user-generated images
store imade in db 
ew
🤷 i just think will be bad for u to write many files sync. u could store a timestamp or something on the end of filename so it has less chance of clash
i have 3000+ user-generated images, 200+mb
How to setup shards for more than 10,000 servers Eris.JS
okay whats the best to use Lol
user uploaded images?
so i dont need to regenerate when they need it again
so a cache system
kinda, but more like file storage for users
store in db 
if you have unique filenames that shouldnt be a problem tho
Database ^^
filenames are timestamp-based, so yeah
where do I put this in Eris JS for shards maxShards: "auto"
then stop writing synchronously
in clientOptions @glacial sentinel
wheres that 
i've had issues with image files being corrupted before, thats why i switched to sync
new Eris(token, {options})
^ 
I got this
when u make new eris instance
okay ty @knotty steeple
u know what nvm samurai explanation is enough
oh yeah thats better after the edit
will this work for 10k+ serves?
depends on ur server and ur code
I dont need another like index js file that runs the shards like in discord.js?
hm ok ty
Umm.. hello! My bot won’t let me type ‘’node index’’ Whenever I typed it it just created a new line in command promptl
are clusters better @earnest phoenix
var bot = new Eris(botconfig.token);
^
ReferenceError: Eris is not defined```
I did `npm install --no-optional eris` 

?
did you define eris?
well eventually running on 1 thread will catch up to you @knotty steeple
but honestly i think even tombot could run without any clusters and be fine
if ur bot does some cpu intensive stuff clusters maybe more important
but then why use node
@knotty steeple WDYM?
he wasnt answering ur q
Oh
Ok
and then u can type in console again
while its running you cant
or just open another 
@pearl parcel you can't dm users you don't have common guilds with, and if you mean dm through the bot, get the user from ID and dm
do it via the bot
i might just remove the feedback command actually and have a support server, probably easier
ok
ty anyway
Gg
where can I find like number 1000 = 1k
like formatter, if you want to say google it then what the key will i search?
bot.on('roleCreate', (role, message) => {
if (!message || !message.id || !message.content || !message.guild || message.author.bot) return;
const channel = message.guild.channels.find(uh => uh.name === "log");
if (!channel) return;
let mdembed = new Discord.RichEmbed()
.setTitle(`**__רול נוצר__**`)
.setAuthor(`יוצר הרול: ${role.created.tag}`, message.author.avatarURL)
.setColor('RANDOM')
.setDescription(`**שם הרול:**\n${role}`)
.setTimestamp();
channel.send(mdembed)
})
someone can fix this to me?
its not work
what about it is not working
also why are you checking for message variables
when its a role
bot.on('roleCreate', (role) => {
console.log(`עובד`)
const log = bot.guild.channels.find(uh => uh.name === "log");
console.log(`2 עובד`)
if (!log) return;
let mdembed = new Discord.RichEmbed()
console.log(`3 עובד`)
.setTitle(`**__רול נוצר__**`)
.setAuthor(`יוצר הרול: ${role.created.tag}`, role.created.avatarURL)
.setColor('RANDOM')
.setDescription(`**שם הרול:**\n${role}`)
.setTimestamp();
log.send(mdembed)
})
@earnest phoenix
console.log(`3 עובד`)
is what causes to throw an error there.
you sure?
actually
maybe it is
they should put it underneath
Hello. The bot on my server keeps going offline for some reason. At first I though there is a problem with the server where I have the bot so I started my local one. That one also goes offline. Can anyone tell me why would it do that?
what you mean?
I made a bot
upload it to a server
and for 1 month it worked perfectly
today it started going offline and coming back online
So I said maybe its a server problem. I runned my local bot to check
and my local one also goes offline
Any error?
maybe discord is having connection problems
Might
o so that is a posability?
yes
is there something I can do in this case?
guys, is there a way to "detect" region change with discord.js?
someone has the code or trick to help with jimp
no one is giving you code
did you have something to help me?
no
ok
Guys ?
Yes sir
:
baguette
fonction.channellogs(message)
if (!Dresseurs[sender.id]) return message.channel.send(`Vous devez être un dresseur pour commencer (Commande : \`${prefix}Start\` )`)
var Dresseur = [];
var NbPokemons = NbPokemons
var Team = Team
var Noms
var nb = 0;
var rank = 0;
for (var i = 0; i < message.guild.members.map(user => user.username).length; i++) {
if (Dresseurs[message.guild.members.map(user => user.id)[i]]) {
nb++;
var Dresseur1 = Dresseurs[message.guild.members.map(user => user.id)[i]];
Dresseur[nb] = {
Points: Dresseur1.Points,
NbPokemons: Dresseur1.NbPokemons,
Team: Dresseur1.Team,
Nom: Dresseur1.NomDresseur
}
}
}
Dresseur.sort(function (a, b) {
return b.Points - a.Points;
});
for (var i = 0; i < nb; i++) {
if (Dresseur[i].id == i) {
rank = i;
}
}
var TopMsg = "";
var topcount = 1
for (var i = 0; i < 6 - 1; i++) {
if (Dresseur.length < 5) return message.channel.send('Pas assez de Dresseurs sur ce Discord pou effectuer la commande : **Top** (- de 5 Dresseurs)')
TopMsg += (`\n[**${topcount}**] - ` + `**${Dresseur[i].Nom}**` + " : " + `**${Dresseur[i].Points}**` + " Points | " + `**${Dresseur[i].NbPokemons}**` + (' Pokémons | Team : ' + `**${Dresseur[i].Team}**`))
topcount++
}
const TopPoints = new Discord.RichEmbed()
.setColor(0xFF88FF)
.addField("Top Dresseurs du Discord :", TopMsg, false)
message.channel.send(TopPoints)
}```
How to make my top shows the trainers of ALL discords
@late hill
uhm
So @late hill ?
hi dont ghost ping random people
I ping just weslay
is there a way to detect a server region change?
You can go private ?
Hey i have a problem with my gif (dog and cat) code:
if(message.content.startsWith(`${prefix}dog`)) {
let {body} = await superagent.get(`https://random.dog/woof.json`)
let dogembed = new Discord.RichEmbed()
.setAuthor('Dog')
.setColor('RANDOM')
.setImage(body.url)
message.channel.send(dogembed)
message.delete()
}```
the error:
SyntaxError: await is only valid in async function
any idea what the problem might be?
looks like like superagent isn't an async function @earnest phoenix
ik
but
how i can make for repair my code
for always be a gif code
remove it
...
but
let {body} = superagent.get(https://random.dog/woof.json)
that's it
you can't use await with superagent
some problems
so
@earnest phoenix
first things first
remove await from your code
k
and
you need to put `
k
before and after the link
oh
nice
ReferenceError: superagent is not defined
...
have you imported it?
yes
:/
can you send me prints?
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\darkr\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\darkr\package.json'
npm WARN discord.js@11.4.2 requires a peer of bufferutil@^3.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.4.2 requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.4.2 requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.4.2 requires a peer of opusscript@^0.0.6 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.4.2 requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.4.2 requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.4.2 requires a peer of uws@^9.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN darkr No description
npm WARN darkr No repository field.
npm WARN darkr No README data
npm WARN darkr No license field.
+ superagent@4.0.0-beta.5
updated 1 package in 1.59s```
I mean
inside the class
const superagent = require(`superagent`);
ty
:/









