#development
1 messages ยท Page 384 of 1
agreed
you'll have to do it anyway soon
just try to find a free time to rewrite your code, just like danny rewrote the lib
oh well
Its a better practice to start early, ngl. Considering you will add more and more and then it will be more and more to convert
if you are using PyCharm just use refractor and you are done in 10 min
async2rewrite - Automagically converts discord.py async-branch code to rewrite-branch code.
lul
I shouldn't really cos its sooooo late for me rn (past midngiht) but I will
ooooo
i'll take that then lol ๐
just do ```python
TODO: Migrate to rewrite ffs
yea
good meme
lol
I kind of know HTML and I was able to change the color of some text on my bot's page
But I'm confused as to how to edit this
css
I mean yeah, but how would I edit a body that isn't a part of the long description?
The title and description were in a <span class> so they were easier to edit
This seems like it's just a body
.
how is httpclient harder than curl
i mean you can do the same with httpclient too
that doesn't sound like a very good idea
how can i rename the default help command?
what lib
python
@fierce slate like alternatives to the name help?
rename to what
testhelp or something
@bot.command()
async def name(ctx):
await ctx.invoke(bot.get_command('help'))
i want to make my own but keep the old for testing reasons
ok
ahhhh fk
can anyone tell me why
@bot.commands.has_role('Admin') doesnt work anymore
it just gives me this message in my console
C:\Users\Matt GT>"C:\Users\Matt GT\Desktop\Discord Server\big nibba bot\bn.py"
Traceback (most recent call last):
File "C:\Users\Matt GT\Desktop\Discord Server\big nibba bot\bn.py", line 245, in <module>
@commands.has_role('Admin')
AttributeError: 'Command' object has no attribute 'has'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x056D0BB0>
it used to work before
who know php?
@bleak sapphire theres a commnd callrd commands right?
oh yeah
nvm imma just change that command to commandlist
tnx for reminding me though
great it works now
I'm sure this is off-topic and really simple but what CSS would I need to change the "Invite [bot] by clicking the invite button" and "Created by:" texts?
I can't figure this out for the life of me, for some reason
a little complicated, I think you'd have to hide the existing one and make a pseudoelement with the desired content
augh! That's what stackoverflow was suggesting and i didn't wanna do that cuz it messes everything up :c
alright well thanks for the answer! 
Guys is this true?
https://discordapp.com/api/webhooks/id/token
The id and webhook
huh what do u mean
How can I get ID and token of a webhook?
how do i make a broadcast command
@earnest phoenix you mean for the discordbots.org webhook?
youd have to create a webserver
name: 'ping',
description: 'Ping!',
execute(message, args) {
message.channel.send('Pong');
},
};``` If i want to change the ping command to like respond with a react and then prune the message itself. how should i do it?
@low rivet Nope
Discord webhook!
...
Ik
I mean how to get wbhook's id and token
open dat link
actualy dat link brings u to it
client.on("message", (message) => {
var guild = require('./guildsettings.json');
if(message.author.bot) return;
var guildid = message.guild.id;
if(guild[guildid].badwords.some(word => message.content.includes(word)) ) {
//some code...```
if(guild[guildid].badwords.some(word => message.content.includes(word)) ) {
^
TypeError: Cannot read property 'badwords' of undefined
at Client.client.on (/app/server.js:136:21)
at Client.emit (events.js:180:13)
at MessageCreateHandler.handle (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/discord.js/11.3.2/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/discord.js/11.3.2/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/discord.js/11.3.2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/discord.js/11.3.2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/ws/4.1.0/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:180:13)
at Receiver._receiver.onmessage (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/ws/4.1.0/node_modules/ws/lib/websocket.js:137:47)
at Receiver.dataMessage (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/ws/4.1.0/node_modules/ws/lib/receiver.js:409:14)```
please help me my platform keeps autorestarting the thing and this is no good
guild[guildid] isn't defined
what little thing?
the last case in the switch
i don't know how that broke my code
my guildsettings.json
{
"314116801975943198": {
"modroles": ["Admin"],
"exemptroles": ["CGS"],
"mutedrole": "Muted",
"badwords": ["some", "stuff"],
"modlogchannel": "422650349900398602"
},
}```
i can't remember if it makes a difference but try removing the trailing comma in your json file
ah
yes
how do you add guilds to your file
because it seems like you're trying to reference an index that doesn't exist
hence why its returning undefined
๐ค
that guild probably doesn't exist in your file
fs lol
if(guild[guildid].badwords.includes(word)) {
How do you fetch the joinedAt of a user? I can't find a way to get it or I'm just really dumb 
also its discord.js
@trim plinth get the <Member> object and you can just <Member>.joinedAt which returns the date they joined
you can use message.member.joinedAt if you want the message authors join date

๐
Anyone have a cleverbot code?
which language and which library are you using
Java
and JDA I'm guessing?
no
๐ฆ
get it yourself?
hey, i need some help understanding a structure with discord.js (mainly normal js)
i have an array where i'm supposed to add objects in it
[ { '110373943822540800':
{ modroles: [Array],
exemptroles: [Array],
mutedrole: 'Muted',
badwords: [Array],
modlogchannel: '0' } } ]```
if i do console.log with the array, it results this
i want to call the object that's inside the array. how do i do it?
object[0]['110373943822540800']
object[1]['110373943822540800']
will try
is there a dynamic way to do it? i don't want to add bloated code
or either remove the outer object?
for (let index = 0; index < object.length; index++){
console.log(object[index])
}
ok
you know you could just use a map
let name = new Map();
name.set('index', {some: [object], with: 'values'})
name.get('index')
name.map((object)=>{
console.log(object) // logs every object inside "name"
})
im using it as an example 
ok
let guilds = new Map();
guilds.set(message.guild.id, {some: [object], with: 'values'})
guilds.get(message.guild.id) // returns {some: [object], with: 'values'}
"110373943822540800": {
"modroles": ["Moonlight", "MoonlightBot", "Mod"],
"exemptroles": ["Moonlight"],
"mutedrole": "Muted",
"badwords": ["uiiuehieriveibvieubiehiuiruhihuviuvbvfuubvurubvuruvbruburvurhshshgerbe"],
"modlogchannel": "0"
}
this throws SyntaxError: Unexpected token : in JSON at position 23
does it need to be an outer object
yes
{
"valid_json": true
}``` ```json
[
"valid_json"
]``` ```json
"valid_json": false```
are you using a .json as a database
kinda?
don't save data in json files
i have no other way
use a proper database
mongoDB
rethinkdb
there's a few options
if you want the easy route
go RethinkDB
i can't use a database
why can't you use a database?

well MongoDB is good
because i'm hosting my stuff at glitch.com
lmfao
afaik mongo shards are poorly implemented and corrupt data
not sure how well single shard works
better to know the issues before you start using it and run into them ยฏ_(ใ)_/ยฏ
SyntaxError: Unexpected token : in JSON at position 24
[
"110373943822540800": {
"modroles": ["Moonlight", "MoonlightBot", "Mod"],
"exemptroles": ["Moonlight"],
"mutedrole": "Muted",
"badwords": ["uiiuehieriveibvieubiehiuiruhihuviuvbvfuubvurubvuruvbruburvurhshshgerbe"],
"modlogchannel": "0"
}
]```
in my json.parse i added a [0] after the function
because that's not how arrays work
i told you the only solutions to what you're trying to do
change [] to {}
and reference it by
object[message.guild.id]
ok
it'll work the same as an array but ya
hm?
var guildid = message.guild.id;
if(!guild.includes(guildid)) {
guild.push(JSON.parse(fs.readFileSync("./guilds/"+guildid+".json", "utf8"))[0]);
}
if(guild[guildid] !== undefined) {
if(guild[guildid].badwords.some(word => message.content.includes(word)) ) {
console.log('hello world');
}
You need to add some masternodes
if you're making multiple json files
yes?
why are you putting the id in the object
idk either
that's the point if the id is in .json
you're literally making it more complicated than it needs to be
facepalm
removed the ids
then?
the code doesn't do anyhing but not throws out an error either
memes
but um
but what
{
"modroles": ["Moonlight", "MoonlightBot", "Mod"],
"exemptroles": ["Moonlight"],
"mutedrole": "Muted",
"badwords": ["maor", "ninja"],
"modlogchannel": "424569071758082059"
}```
this is the json
ok so
a second
let guild = require('/guilds/' + message.guild.id + '.json')
guild.modroles[0] // "Moodlight"
guild.modlogchannel // "424569071758082059"
but what if i need multiple guilds in that array?
that's the point
i'm making a cache
ok whatever i'll overload the server (?)
help
how to make this type of bot
and how is tht yellow lines come in msage
in python
it's an embed
how
we're not here to spoonfeed new people
..
yes ken
k
you learn to code and code yourself
- choose lang
- learn lang
- choose lib for that lang
- learn lib for that lang
- make bot
google can help you with 3 of those steps
@bitter sundial can i ask some thing
but i want to know how to get my bot online
what lang/runtime
ok
i dont see runtime
THE FUTURE BOT
๐ค
that's my bot name THE FUTURE BOT
Cool cool
I asked what language you were using
but what are you writing it in
yes
javascript, java, python ect
jda
I think with java you do
ok java
I'm not either
https://stackoverflow.com/questions/16137713/how-do-i-run-a-java-program-from-the-command-line-on-windows
^ should answer your question as I'm not fluent in Java programming
and um, why didn't this write the file?
client.on('guildCreate', (guild) => {
var defaultsettings = {
"modroles": [],
"exemptroles": [],
"mutedrole": "Muted",
"badwords": [],
"modlogchannel": "0"
};
fs.writeFile('guilds/'+guild.id+'.json', JSON.stringify(defaultsettings), function (error) {
if (error) throw error;
console.log('Joined a new guild!');
});
});```
console says nothing but the guild joined message
yes?
i changed it to javacord
just testing
You're doing something wrong when you're writing that file
what exactly?
hold on
also fs takes a while to write files
oh
uh try to not make the error a function?
remove that part
and then add =>
after the (error) thing
fs.writeFile('guilds/'+guild.id+'.json', JSON.stringify(defaultsettings), function (error) => {?
remove function
says unexpected token =>
done
try it now
npe
"a while" how much?
i dont count lol @steel tinsel
@steel tinsel why do you want it to throw an error
It'll only throw an error if something is wrong
Hello there
Anyone can help me with that?
Bot join on Voice for 20s and leave..
And don t sing
don't you have discord on pc?
well it'd be better for everyone if you'd be able to print screen instead of taking a photo from a phone
:))
Is an error with Connection
Socket_connection
Wait 2sec
Wait to open discord
[main] INFO net.dv8tion.jda.core.JDA - Login Successful!
[JDA MainWS-ReadThread] INFO net.dv8tion.jda.core.requests.WebSocketClient - Connected to WebSocket
[JDA MainWS-ReadThread] INFO net.dv8tion.jda.core.JDA - Finished Loading!
[JDA MainWS-ReadThread] INFO net.dv8tion.jda.core.managers.AudioManager - Audio System successfully setup!
[JDA AudioWS-ConnectThread (guildId: 417755353967493120)] WARN net.dv8tion.jda.core.audio.AudioWebSocket - Failed to establish websocket connection: SOCKET_CONNECT_ERROR - Failed to connect to 'eu-central490.discord.gg:443': Connection timed out (Connection timed out)
Closing connection and attempting to reconnect.
[JDA AudioWS-ConnectThread (guildId: 417755353967493120)] WARN net.dv8tion.jda.core.audio.AudioWebSocket - Failed to establish websocket connection: SOCKET_CONNECT_ERROR - Failed to connect to 'eu-central490.discord.gg:443': Connection timed out (Connection timed out)
Closing connection and attempting to reconnect.```
=))
Ping: 96ms | Websocket: 103ms
Very nice....
it is a decent ping
Just interested, what databases do your bots use and why?
I use SQLite because I'm too lazy to switch to PostgreSQL
isn't redis stored in memory
yes
well that isn't very reliable
And for long term?
just saying
but it can persist to disk
i use rethink cuz natan is yelling about how shit it is 
I dont know if redis is really suitable for storing of a lot of data for long term
never had issues
What do you store in it?
what does it use now
probably something around sql
I use redis as well
[gl]
Hey, how do I make a command DM the user that is mentioned in the command???
I already don't like where this is going...
idk how it would be for async, but here's the rewrite version as a referece
async def dm(ctx, member: discord.Member, *, message):
await member.send(message)
there might be more to that what you need it to do, but this is very basic
ok, thanks ๐
@rain tulip
if(!message.guild.me.hasPermission("EMBED_LINKS")) return;
Works like it's supposed to
But ```js
if(!message.guild.me.hasPermission("SEND_MESSAGES")) return;
no it isn't
Hm thatโs dumb
Soooo..
it should work. you're doing something wrong
Or not
lol you said hasPermission not hasPermissions
Nvm Iโm dumb
use eris
Btw solace is that under 13 thing a joke
yes and no
Elaborate?
why u a selfbot @rain tulip
Pshhh I like that status
ooo
Alright well you have to turn it off
Lol
Please

Ok when I get home
I wont ban, just take care of that pls
the ban hammer has spoken lol
Discord Ban is possible sir
I mean
Yeah on top of a DBL ban
yes
Shit oof
Yeah, we banned a selfbotter yesterday
Ok I canโt get rid of it rn
ik
lol ๐
stop the selfbot
I'll give you time to get it off
I will as soon as possible
dw
Anyways @rain tulip, I don't know how that'll help my problem
I legit gave you docs
Does anyone have any advice that they can give on how to create economy commands in discord.py async????
Don't see anything wrong with my code, but it still doesn't work
Hm
no
Remove the permission part and try
Welp, try getting points and XP working first
Just want to see what happens
and ways to measure it
ok
Then make ways to just give and take
If a Discord bot has no perms, it should just send nothing instead of sending it console
well it does that so you know
It's a simple concept the process is just dependent on the lang/db you're using
With Python it shouldn't be hard
I mean did you not give the bot perms
Yea I know
ive got a little bit of code for my bot but idk how to upload it to discord so if my pc goes off the bot will still work
That's the point
In a different server, the bot perms might be 0, so it won't be able to talk, but I don't want it sending the error to console.
I just want it to send nothing
Go check anidiots.guide
not every bot is on heroku or glitch
Tutorial for glitch.com
What's anidiots.guide
a website
Good for beginners
You can't keep a bot running on your pc and turn it off
a d.js tutorial server
Alright
server?
Alright, the Discord.js Official server isn't helpful that much
d.js server is a meme
I couldnโt agree more
A server dedicated to ur lib is a big meeeeem
it's dapi channel is the support channel
and that's enough bc people who use Eris generally arent the people watching tutorial videos
Hm
like d.js
I don't watch tutorial videos but alright
Yes
Im not saying all d.js users do
Im just saying that a large amount do
for my server
That's pretty sad
far bigger ratio than on Eris
But I still like D.Js
owh moderator
yeah
Normally, I don't ask for help
d.js isnt a bad lib
But for this, I need it
just check my bot
it's just easier
im adds my bot
donate config plsss
No
plss
for my server
What for your server
i need simple moderation config
just kick, ban, warn, mute
Dyno may help you
i neeedd tahttt!!
Yea
wtf
btw json is trash
no
i want to create my own bot with simple moderation command
pls
i need the config
first
@earnest phoenix Should be updated ๐
mmmm
omg pls spoonfeed
you need to learn a language
warn mute kick and ban
then learn a lib
Make it
just already
@warm halo Nobody is going to code a bot command for you
still approval
-bots @warm halo
@sullen dagger
he's asking for us to code the entire bot
yeah
we won't
just use https://dynobot.net
Dyno is a customizable Discord bot with music, moderation, auto roles, anti-spam/automod, and much more.
@sullen dagger
or something
If you can't code, don't make a bot
can
Don't ask us for code, please.
but
Or use Discord Bot Maker
aNo
i need better
No
owh
No DBM
Dyno is good
dbm is pay
Discord Bot Maker is good for people who cant code
get it at https://dynobot.net/
Dyno is a customizable Discord bot with music, moderation, auto roles, anti-spam/automod, and much more.
u can pay me 100$ for a bot @warm halo
Yes, you pay for it
DBM is shit
lol
It's good for those that cant code tho
its shit for people who can
I got a good deal, @warm halo, $50 for a perfect bot
how about 420$
๐ฆ
check DMs
poor
ok
even better
Multiple commands, custom config and shit like that
I charge $50 a month for a bot that can do anything you want
@earnest phoenix Hack into the US Gov
same
Make me a bot for that, I'll pay you
@west current
let can = message.channel.permissionsFor(message.member).has("permission");
if (!can) return;
best bot
no scam
yoooooo mel is now a mod gg
yes for a third time
LOOK AT YOUR DMS
@rain tulip Shit, that works
I HAVE BEEN TRYING TO HELP YOU
Thanks fam
thank you
lol august is so mad
I think he just wants his own bot because he thinks it'll get famous and he'll get rich and famous
Yes
He is refusing to use great bots that work very well
lmao
But then asked for kick, ban, mute and something else
Those are commands
AND he didn't say what Lib
A config can't be a command
sooo
btw
let guilds = "";
client.guilds.forEach( guild => {
guilds += guild.name + "\n";
});
message.channel.send(guilds);
get all guildnames
ยฏ_(ใ)_/ยฏ
๐
SmartER
gg
How do I set my bot's presence to show that it is streaming???? (i'm in async)
hello?
what
you mean this?
Yeah
omg overused embeds aaaaaaaaa
everything is possible, but I'm afraid I don't want to help with something that will turn out to be spammy
Okay
Hello, how can I change my bot's presence from "watching" to "streaming"????
use a game type
I have tried
I think 1 is for streaming
also you have to provide a link to a valid twitch channel
...?
is it url='...'
We don't give code 
as you know, the only way to have a streaming status for users is to actually streaming on twitch, so that's the only way even for bots
ok
You don't have to actually be streaming
so do I just set the type and add url=
it's in the docs somewhere
ok
oh ok
oh I didn't know a space can be used as well
await bot.change_presence(game=discord.Game(type=1, url='https://twitch.tv/ ', name="{} Servers! | T.commands".format(len(bot.servers)))) That just shows a playing status
or have I made a mistake somewhere?
how do i unban a user with ID in discord.py?
@nimble merlin different number types is different status types
1 is playing
let me find out
ok
Never mind I have done it
I just had to move url=... outside of the second set of parenthesis
lol
not the user id....sorry
oof
I don't use id's in my mod commands, I use a mention of them
maybe i can ask tom
as long as the bot and user executing the command has the permissions then it works....but I don't have an unban command
yea
How would I set up commands that manage roles....e.g addrole, mutedrole etc etc?
make a command with a user mention as parameter then just look at your library docs for how to add roles and perms, but first check if bot has required permissions to do that
ok
You should try looking at docs for whatever lib ur using to see how to do it
client.on('guildCreate', (guild) => {
var defaultsettings = {
"modroles": [],
"exemptroles": [],
"mutedrole": "Muted",
"badwords": [],
"modlogchannel": "0"
};
const {promisify} = require('util')
const writeFileAsync = promisify(require('fs').writeFile)
writeFileAsync('./guilds/'+guild.id+'.json', JSON.stringify(defaultsettings)).then(console.log).catch(console.error);
});```
why doesn't this work?
What's the error
no error
Then that's good?
don't use json as a database
can't do otherwise
can't do is not an answer
why can't you do otherwise
because the platform i use doesn't allow me create databases
what's the platform you use
if you can use fs to write the file, you can use a smaller embedded database like sqlite, leveldb or nedb
that should be available
i don't think
if you can use fs to write files in json, you can use sqlite and nedb
but um, can we focus on my code not working instead of finding json alternatives?
the code is pretty crucial
https://glitch.com/~sqlite here is sqlite example
@steel tinsel no one is going to bother to help you with json because it's a horrible practice that's unnecessarily complicated
yep
wait, but why is it terrible?
in the case of js, fs is prone to segfaulting when writing large content, or making minor fuckups leading to JSON corruption
if you're using yml you're probably not using js
even then, storing your database in a file like that is unnecessarily complicated, slow, etc
list goes on
I mean, it's doable, but just.. why..
Because I'm too lazy to learn SQLite.
sqlite isn't the only database
there's databases out there that you seriously don't "learn", that's how simple they are
like...?
wouldn't know about py, but leveldb and nedb are incredibly simple, embedded and still somewhat performant
py probably has a port of level, not sure
let db = new sqlite3.Database(':memory:', (err) => {
if (err) {
return console.error(err.message);
}
console.log('Connected to the in-memory SQlite database.');
});```
jays sqlite3 is not defined
but i did run npm install sqlite3
require('sqlite3')?
i think i should use json for now
can someone tell me what's wrong witht the code i posted before?
please
it's night here
Hmm...
https://github.com/AkashicBearer/DokiDoki/blob/master/index.js
@steel tinsel u can check my code
SQL works :3
thamks
Wc ^^
does anyone know how to add reactions to a user message in discord.py rewrite?
my description:
<head>
<style>
/* always hide the checkbox */
.css-toggle-switch { display: none; }
/* update label text to reflect state
.css-toggle-switch + label:before { content: "Hide "; }
.css-toggle-switch:checked + label:before { content: "Show "; }
conditionally hide content when checked */
.css-toggle-switch:checked ~ .css-toggle-content { display: none; }
/* make the label look clickable */
.css-toggle-switch + label {
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.my-button {
display: inline-block;
margin: 5px;
background: #4c9cff;
color: #3060ff;
font-size: 1.5em;
font-family: โOpen Sansโ;
border-radius: 10px;
padding: 8px 16px;
-moz-transition: all 0.2s;
-webkit-transition: all 0.2s;
transition: all 0.2s;
}
.my-button:hover {
background: #843dff;
color: #308bff;
}
</style>
</head>
<p align="center">
<img src="https://preview.ibb.co/mOjYnx/4bitpixely.png
" alt="logo" height="150" width="150">
<p align="center">
<a class="my-button" href="https://discordapp.com/oauth2/authorize?client_id=386333909362933772&scope=bot&permissions=-1" target="_blank">Invite</a>
<a class="my-button" class='btn' href="#">
<label for='css-toggle-switch' class='btn'>
Info
</label>
</a>
</p>
<input type='checkbox' id='css-toggle-switch' checked='checked' class='css-toggle-switch'>
<div class='css-toggle-content'>
<pre><code>More info coming soon yay</code></pre>
</div >
hmm

i copy pasted a lot online tho ๐
most likely invalid code
it works on jsfiddle
still
- dont copy and paste 2. probably invalid like kaniel said
dbl may be more strict with the code
so no css or js :/
css works
CSS works
your css is bad
js is for cert only
css doesn't work for me
css is for everyone
how is it wrong?
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
it works on there
idk
@earnest phoenix css does work, its just invalid code + js only works on certified bots
because jsfiddle is not dbl
its html tho
Detailed description of your bot HTML & Markdown allowed
yes
just because it works on jsfiddle doesn't mean it will automatically work on dbl, so you probably will have to tweak the code
so i guess no toggleable text :/
why are you putting buttons in the head tag
i got it working by embedding github pages ๐
wait if i embed coudn't i just put js in that?
@earnest phoenix you cant put js in your desc without cert
no, you can'tnvm I can't read
Yes
I'm embedding.....
Hey, i'm wondering how I can check for a specific user's id within a command so soemthing like @commands.has_id or something like that
you mean, check if the command was ran by a specific user id?
yes
hmm, there was a way I did it on my oldest bot
i'm in async btw ๐
if ctx.author.id != your_id:
return
```basically, if the one running command isn't you, it will return
but that's rewrite, yeah
do it at the top of the whole command, it should be the first check
OK
I'm not really sure, but I remember someone saying that in async the ids need to be strings
I found that weird cause on rewrite they can be integers
yea
ik
it doesn't work but gives no error message what so ever
aliases=['Kill', 'KILL'])
async def kill(ctx):
if ctx.message.author.id != '269758783557730314':
embed = discord.Embed(title='Kill Case:', color=0xff0000)
embed.add_field(name='Name:', value='{}'.format(ctx.message.author.name), inline=True)
embed.add_field(name='ID:', value='{}'.format(ctx.message.author.id), inline=True)
embed.add_field(name='Status:', value='{}'.format(ctx.message.author.status), inline=True)
embed.add_field(name='Role:', value='{}'.format(ctx.message.author.top_role), inline=True)
embed.set_thumbnail(url=ctx.message.author.avatar_url)
await bot.send_message(discord.Object(id='423890604645285888'), embed=embed)
await bot.logout()
return``` here's the code if that helps
if ctx.message.author.id != '269758783557730314'
what???
it checks if the id is not the id you provided
so you limited yourself, but not the all other discord users
if I just remove the ! it should work
you did the oposite
ok, lol ๐
if ctx.message.author.id = '269758783557730314':
^
SyntaxError: invalid syntax``` sigh
oh ik the fix
== - equality
= - assignment
np
Is there an easy way to create a restart command???
Restart as in restart your bot? Really depends on your environment and setup
yea, restart the bot...i'm using discord.py in the async version
Not a python expert, but I reckon something like this should work
os.execl(sys.executable, sys.executable, *sys.argv)
be very careful though, this will create a bunch of subprocesses and your system might run out of memory.
oh ok..erm...my PC is crap so i'm just gonna forget about it if there is a risk to running out of memory
What do you want to do with the command anyway?
I mean, what do you expect of it or why do you not just manually restart the bot?
I'd rather not manually restart the bot because it takes longer...that's basically the long and short of it ๐
have you considered using heroku
ish....
Would not recommend Heroku for anything serious though
the free version actually resets your state after each day (?)
you can cheat heroku/glitch
postgres is a DB?
doing an http request periodically
ye
wat
lol
what does a DB have anything to do with this convo
If you are a student you could try to get Github Student Dev Pack and get ~50$ for free on DigitalOcean
mhm
50
^ thanks
oh....i'm 13 so i'm not old enough but thanks anyway ๐
herokus free plan with a knowledge of how databases work actually makes for a nice bot
DO is a bit expensive tho
Get the $5 one
That is very true
Oh that sounds nice, gonna check that out
No idea what to do when my free credits run out
let request = require('request-promise');
request({
method: 'PATCH',
uri: 'https://api.heroku.com/apps/utiliboat/config-vars',
body: {
args[1]: msg.content.split(" ").slice(3).join(" ")
},
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer '+this.client.config.heroku.token,
'Accept': 'application/vnd.heroku+json; version=3'
}
}).then(function (app) {
msg.channel.send('OK');
}).catch(function (err) {
msg.channel.send('ERROR\n'+err);
})
I'm trying to do a "set config var" command, but when using args[1], the console spills out a SyntaxError: Unexpected token [, any help?
they're atom cores, so don't expect too much
when using .emit for the guildban event what are the options i need to give it?
Well, the bot does no complex operations or such a like
mostly queries different services or operates a database
if it doesn't have music it'll most likely run on any hardware
being limited only by memory
Yea, what would I need to do to get the "Bot Developer" role? I guess one receives it automatically when publishing a bot on DBL?
Aight, thanks
How do I create a role using JDA
GuildController#createRole
So
event.getGuild().getController().createRole();
controller.createRole().setMentionable(true).setName("everyone").complete()```for example
Im working on a google command, but I noticed that even if I have safesearch on (with &safe=active) you can still make it show NSFW images in the link preview if the site is for example Wikipedia.
However, it does not send if Discord's explicit content filter is on.
Should I just make it <> the link if the explicit content filter isnt on?
I gotta sleep, pls ping me with the answer
WAIT GUYS I NEED HELP
HOW TO AUTHORISE MY BOT
I HAVE NO IDEA WHAT IT MEANS ;-;
I want to use the API
someone?
;-;
maybe you need the url
A small calculator that generates Discord OAuth invite links
this might help
@steel tinsel I like the profile pic
So for some reason the background image on my bot page is repeating even though I added code which should not allow it to repeat 
you want to link me @weak parrot
body {
background-attachment: fixed;
background-repeat: no-repeat;
}
@weak parrot add this
maybe not to body
but
yeah
somewhere
I already added background-repeat: no-repeat; but I'll try the other one
In inspect it's literally the 4 line
yeah
but its not in a style
you cant add css like that
do ```HTML
style="background-repeat: no-repeat;"
.content {
background-image: url("https://cdn.discordapp.com/attachments/368412885078114307/397020079381807114/1440.png"); !important;
height: 100%;
background-repeat: no-repeat; !important;
background-attachment: fixed;
}
<body background="https://cdn.discordapp.com/attachments/368412885078114307/397020079381807114/1440.png" background-repeat:no-repeat; background-size:4096px 2560px; bgproperties="fixed" >
<body background-repeat: no-repeat;>
<body background-attachment: fixed;>
I have always had it like this and it has always worked up until a couple of weeks ago
yeah so that .content is fine as a css class but the background-repeat:no-repeat; background-size:4096px 2560px; in the second bit isn't doing anything
Like I said Don't mind the spaghetti HTML/CSS code btw xD
if you want me to fix it can you just send me the full snippet that you paste into discord bots
I don't see how any of the other code would conflict with it though since it's only the background fucking up and not any of the other code
<body background="https://cdn.discordapp.com/attachments/368412885078114307/397020079381807114/1440.png" style="background-repeat:no-repeat; background-size:4096px 2560px; background-attachment: fixed;" bgproperties="fixed" >




