G
G
gensekcpss2022-02-15 17:46:26
Python
gensekcpss, 2022-02-15 17:46:26

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

1 answer(s)
S
soremix, 2022-02-15
@SoreMix

1. How did you install it, where did you install it?
2. To be honest, I doubt that there is a module with such an import
3. What for is it needed in the end?
Looks like a copy-paste of code without understanding

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question