Answer the question
In order to leave comments, you need to log in
When the bot starts, it writes no module named keep_alive, although I installed it. Why? (all bot code below)?
import discord
import keep_alive
from discord.ext import commands
import os, sqlite3
import json, string
import requests
from dotenv import load_dotenv
import youtube_dl
import asyncio
bot = commands.Bot(command_prefix='#', intents=discord.Intents.all())
@bot.event
async def on_ready():
print('Дарова, я Олег')
global base, cur
base = sqlite3.connect('ZIO.db')
cur = base.cursor()
if base:
print('DataBase connected...OK')
@bot.event
async def on_member_join(member):
embed = discord.Embed(color = 0xff0000, title = 'Приветсвую на сервере Анархии.\nПравило номер один: ты пидор по определению\nправил больше нет, делай что хочешь, но большой брат следит за тобой ')
await member.send(embed=embed)
for ch in bot.get_guild(member.guild.id).channels:
if ch.name == 'основной':
await bot.get_channel(ch.id).send(f'{member.mention}, ты чмо')
@bot.event
async def on_member_remove(member):
for ch in bot.get_guild(member.guild.id).channels:
if ch.name == 'основной':
await bot.get_channel(ch.id).send(f'{member.mention}, нам будет тебя не хватать')
@bot.command()
async def info(ctx, arg=None):
author = ctx.message.author
if arg == None:
await ctx.send(f'{author.mention} \nВведите:\n#info me\n#info comm')
elif arg == 'me':
embed = discord.Embed(color = 0xff0000, title = 'Я Олег, я мало чего могу, но напиши #info comm узнаешь все мои способности.')
await ctx.send(embed=embed)
elif arg == 'comm':
embed = discord.Embed(color = 0xff0000, title = 'Все команды:\n#fox - рандомная картинка лисы\n ')
await ctx.send(embed=embed)
else:
await ctx.send(f'{author.mention} \nТы тупой, шо ты высрал?')
@bot.command()
async def fox(ctx):
response = requests.get('https://some-random-api.ml/img/fox')
json_data = json.loads(response.text)
embed = discord.Embed(color = 0xff0000, title = 'Лиса')
embed.set_image(url = json_data['link'])
await ctx.send(embed = embed)
bot.run('OTQyODM5Njc3ODk4MDg0Mzky.YgqV4A.VOKtn4mSqHEP1LzhLLOQVqASpYg')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question