Per Server Custom Prefixes in Discord.py with PostgreSQL and asyncpg

  Рет қаралды 10,012

Code With Swastik

Code With Swastik

Күн бұрын

Пікірлер
@CodeWithSwastik
@CodeWithSwastik 3 жыл бұрын
I forgot to mention in the video but you'll need to pip install asyncpg if you don't already have it installed! Also when the video get's 100 likes I'll upload the code on github, so make sure to like!
@ProgrammerAyush
@ProgrammerAyush 3 жыл бұрын
You gonna upload the source code to GitHub to spoonfeed like your server?
@SmokxeeOP
@SmokxeeOP 3 жыл бұрын
1 like to go
@clues8012
@clues8012 3 жыл бұрын
Can u do economy with asyncpg
@Paper1988
@Paper1988 3 жыл бұрын
it's already got 100 likes 😂
@tasoulman
@tasoulman 3 жыл бұрын
Code please, aahahhahahaha
@fureai9143
@fureai9143 3 жыл бұрын
Well, this method only works when you wanna host postgres on localhost. Since postgres is a server based db, it needs to be hosted, so I recommend hosting it on a vps such as DigitalOcean or MS Azure. If you host the db on vps, then you need to provide `ssl = 'require'` kwarg while declaring the connection. Hosting services like Heroku provide a postgres add-on which basically adds a DATABASE_URI to your environment variables. *Note:* There is no way of using postgres without hosting it, so you gotta pay or link cc in order to use a vps to host it. Heroku is one of the free options but it has its own limits, so consider linking your credit card to enjoy free vps for some time!
@ProgrammerAyush
@ProgrammerAyush 3 жыл бұрын
POV: Swas is trying to flex his discord server
@isaiahstone2574
@isaiahstone2574 3 жыл бұрын
All my code is correct and it says the connection was successful but when i go to change the prefix i get an error saying guilds does no exist
@meizufluxx
@meizufluxx 3 жыл бұрын
This tutorial *does* work, but this method will query Postgres on every single message the bot receives. The proper way to do this is to write a caching system where you don’t need to query the database every message.
@conos1765
@conos1765 3 жыл бұрын
This is pretty pog
@diogoredondo8363
@diogoredondo8363 3 жыл бұрын
Can you make a tutorial on warn command pls
@GoldenJan
@GoldenJan 3 жыл бұрын
Can you do this wiith cogs too? i'm currently stuck in trying to implement this...
@KillerZM
@KillerZM 3 жыл бұрын
How do I connect it to an external database?
@nishilsheth9076
@nishilsheth9076 3 жыл бұрын
Please make a video like this for MongoDB and please use motor with it!
@meizufluxx
@meizufluxx 3 жыл бұрын
Postgres makes more sense for discord bots as most of the data you will store is relational
@nishilsheth9076
@nishilsheth9076 3 жыл бұрын
@@meizufluxx I need a cloud database so I think MongoDB would be the best choice
@meizufluxx
@meizufluxx 3 жыл бұрын
@@nishilsheth9076 why do you need a cloud database? Installing postgres on a server is super simple
@nishilsheth9076
@nishilsheth9076 3 жыл бұрын
@@meizufluxx oh. I just do not want to host the database or my discord bot. Could you show me how to do it? Like a yt link?
@nishilsheth9076
@nishilsheth9076 3 жыл бұрын
@@meizufluxx I am using replit. Can I use replit to connect to that database?
@0nyxamv
@0nyxamv 3 жыл бұрын
How to change prefix from dashboard?
@rpbricks255
@rpbricks255 3 жыл бұрын
Can you please do a tutorial on a levelling system as I feel it is a subject which does not get that much attention?
@yoavvishne7179
@yoavvishne7179 3 жыл бұрын
Swastik, where can I host my bot if I am using postgresql?
@DalvinNotFound
@DalvinNotFound 2 жыл бұрын
bruh i am getting a error saying `asyncpg.exceptions.UndefinedTableError: relation "guilds" does not exist` when i try to mention and use help or change prefix
@gdkid
@gdkid 2 жыл бұрын
make a table called guilds
@orangegamer
@orangegamer 3 жыл бұрын
A warnsystem with pg would be cool
@dts2716
@dts2716 3 жыл бұрын
This is like SQLite, isn't aiosqlite good?
@SymphonicMelody
@SymphonicMelody 3 жыл бұрын
its pogg
@thegenocide8631
@thegenocide8631 3 жыл бұрын
pog New video
@makiyu3236
@makiyu3236 3 жыл бұрын
it finally happened!! Death to JSON as db :gura_wink:
@geruchslostlost927
@geruchslostlost927 3 жыл бұрын
Thank you ❤
@nikunjgupta3345
@nikunjgupta3345 3 жыл бұрын
Can we run pgadmin4 just on its website, I mean browser or do we need to install and run it? Btw pog vid
@gdkid
@gdkid 2 жыл бұрын
You need to install it
@GH05TYPLAYz
@GH05TYPLAYz 3 жыл бұрын
wheres part 4
@rushanchess
@rushanchess 3 жыл бұрын
Can you make a video on how to create a web server using Python
@rushanchess
@rushanchess 3 жыл бұрын
Nice 👏
@redhawk3385
@redhawk3385 2 жыл бұрын
Make sure you set guild_id in your database to be a primary key, not doing this will inserts a new entry every time you insert
@bruceonion
@bruceonion 3 жыл бұрын
I am just vibin with Mod
@tapu_
@tapu_ 3 жыл бұрын
And that's how you end up with 2000 character long prefix
@mightyzain9032
@mightyzain9032 3 жыл бұрын
IS THERE ecomany part 5 ??
@CodeWithSwastik
@CodeWithSwastik 3 жыл бұрын
Well it will start from Part 1 again lol
@mightyzain9032
@mightyzain9032 3 жыл бұрын
@@CodeWithSwastik huh why
@nish1176
@nish1176 3 жыл бұрын
@@mightyzain9032 cuz he screw up and bad video make
@Cyrus_FG
@Cyrus_FG 3 жыл бұрын
Thank You
@parthiv3255
@parthiv3255 3 жыл бұрын
how long r u gonna keep makign discord bot tutorials :\
@ayushanand9417
@ayushanand9417 3 жыл бұрын
until he or discord dies 🤣
@FrazixOP
@FrazixOP 3 жыл бұрын
@@ayushanand9417 I don't think discord bot Dev's are gonna stop anytime, because they keep adding any new feature for bots just like the Buttons.
@SymphonicMelody
@SymphonicMelody 3 жыл бұрын
enable text wrapping it would be easier :p
@rashmichoubey2029
@rashmichoubey2029 3 жыл бұрын
Make a leveling system (with mongodb) like mee6 (I know how to make it but the custom image you get on leveling up plz show us that....
@LegendYt4k
@LegendYt4k 3 жыл бұрын
can you make a level up commands like @name has reached level 3. GG!
@FrazixOP
@FrazixOP 3 жыл бұрын
I don't know about him but I was working on something like that and I have figured it out how to make a level up thing like mee6 or amari :)
@clues8012
@clues8012 3 жыл бұрын
I use SQLite3(aiosqlite) lol
@manwhas
@manwhas Жыл бұрын
Me who uses a json file
@CodeWithSwastik
@CodeWithSwastik Жыл бұрын
💀
@itsyaboivoid
@itsyaboivoid Жыл бұрын
We got another one of those
@mustafatechsolutions
@mustafatechsolutions 3 жыл бұрын
SWAS UNBAN ME PLSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS I MISS MY 40+ LEVELS!!!!!!!!!!!!!!!!!!!!
@mustafatechsolutions
@mustafatechsolutions 3 жыл бұрын
@boomerify because i was being cooler then swas
@FrazixOP
@FrazixOP 3 жыл бұрын
@@mustafatechsolutions and wat did it cost?
@mustafatechsolutions
@mustafatechsolutions 3 жыл бұрын
@@FrazixOP IT WAS WORTH SWAS'S LIFE
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 222 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
How to make a Discord Bot using Python 2020! (Discord.py)
9:19
Code With Swastik
Рет қаралды 105 М.
What does larger scale software development look like?
24:15
Web Dev Cody
Рет қаралды 1,4 МЛН
The Only Database Abstraction You Need | Prime Reacts
21:42
ThePrimeTime
Рет қаралды 232 М.
Cool Tools I’ve Been Using Lately
23:11
Theo - t3․gg
Рет қаралды 374 М.
Making a Discord Bot In Python (Part 7: Server Prefixes)
15:22
Windsurf vs Cursor: In-Depth AI Code Editor Comparison
18:14
Yifan - Beyond the Hype
Рет қаралды 22 М.
#trending #foryou #challenge #fyp #viral #short #tiktok #vs
0:15
Misiсatсh
Рет қаралды 2,4 МЛН
ЛАЙФХАК НА КУХНЕ ! 🧐🤦🏻‍♂️ #shorts #лайфхак
0:15
Крус Костилио
Рет қаралды 109 М.