Python Forum

Full Version: [Discord.py] Bot sending message automatically
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So i'm trying to make my bot send messages each 2 minutes and right now i keep getting this error.
I really don't know how to fix it so if anyone knows please help.

Error : [Image: gxjpjq]

import discord
import asyncio
import random
import pickle
import os
import json
import requests
import safygiphy
import io

from discord.ext.commands import Bot
from discord.ext import commands

client = commands.Bot(command_prefix="_")


async def randommessage():
    enszomessage = random.choice(["k3k", "k5k", "k6k"])
    await client.say('296381421457637377', enszomessage)
    await asyncio.sleep(120)


client.loop.create_task(randommessage())
client.run(token here)
So, what's the error?
Click on the image (after error) it leads to the error.
Don't post images, but copy/paste the full traceback in error tags.
Do you know how to fix the error tho?
(Oct-15-2017, 03:28 PM)Ouindoze Wrote: [ -> ]Do you know how to fix the error tho?
I guess we shall know once you post the full traceback in error tags... :-)
Never mind, i forgot to say that i got my friend helping me atm, i will come back later to tell you how i fixed the error, or if you can delete this thread :)