The below article will cover the intricacies of setting up databases and heroku in respect to a flask app. This is more like a memo and will have out of sequence instructions or solutions to errors so read thoroughly.
You'll need the packages
The below article will cover the intricacies of setting up databases and heroku in respect to a flask app. This is more like a memo and will have out of sequence instructions or solutions to errors so read thoroughly.
You'll need the packages
string fun1(string s,int k){ | |
if(k>1){ | |
sort(s.begin(),s.end()); | |
return s; | |
} | |
string res=s; | |
for(int i=0;i<s.length();i++){ | |
char ch=s[0]; | |
s.erase(s.begin(),s.begin()+1); | |
s+=ch; |
string fun1(string s,int k){ | |
if(k>1){ | |
sort(s.begin(),s.end()); | |
return s; | |
} | |
string res=s; | |
for(int i=0;i<s.length();i++){ | |
char ch=s[0]; | |
s.erase(s.begin(),s.begin()+1); | |
s+=ch; |
discord_token = "copy_paste_your_bot_token_here" |
import discord | |
from discord.ext import commands,tasks | |
import os | |
from dotenv import load_dotenv | |
import youtube_dl |
load_dotenv() | |
# Get the API token from the .env file. | |
DISCORD_TOKEN = os.getenv("discord_token") | |
intents = discord.Intents().all() | |
client = discord.Client(intents=intents) | |
bot = commands.Bot(command_prefix='!',intents=intents) |
youtube_dl.utils.bug_reports_message = lambda: '' | |
ytdl_format_options = { | |
'format': 'bestaudio/best', | |
'restrictfilenames': True, | |
'noplaylist': True, | |
'nocheckcertificate': True, | |
'ignoreerrors': False, | |
'logtostderr': False, | |
'quiet': True, |
youtube_dl.utils.bug_reports_message = lambda: '' | |
ytdl_format_options = { | |
'format': 'bestaudio/best', | |
'restrictfilenames': True, | |
'noplaylist': True, | |
'nocheckcertificate': True, | |
'ignoreerrors': False, | |
'logtostderr': False, | |
'quiet': True, |
youtube_dl.utils.bug_reports_message = lambda: '' | |
ytdl_format_options = { | |
'format': 'bestaudio/best', | |
'restrictfilenames': True, | |
'noplaylist': True, | |
'nocheckcertificate': True, | |
'ignoreerrors': False, | |
'logtostderr': False, | |
'quiet': True, |
@bot.command(name='join', help='Tells the bot to join the voice channel') | |
async def join(ctx): | |
if not ctx.message.author.voice: | |
await ctx.send("{} is not connected to a voice channel".format(ctx.message.author.name)) | |
return | |
else: | |
channel = ctx.message.author.voice.channel | |
await channel.connect() | |
@bot.command(name='leave', help='To make the bot leave the voice channel') |