Python
1
Вклад в тег
from discord.ext import commands
intents = discord.Intents.all()
command_prefix = "!"
bot = commands.Bot(
command_prefix = command_prefix,
intents = intents,
help_command = None
)
COMMANDS = [
"refresh"
]
@bot.event
async def on_message(message):
if (message.author == bot.user):
return
elif (message.content.startswith(command_prefix)):
if (message.content in command_prefix + COMMANDS):
pass
else:
response = get_city(message.content)
await message.channel.send(response)
@bot.command()
async def refresh(ctx):
refresh()
bot.run(TOKEN)
@client.command()
async def auto_send():
channel = await client.get_channel("channel_id")
while True:
await channel.send("message_1")
await asyncio.sleep(604800) # Неделя
await channel.send("message_1")
await asyncio.sleep(604800)