discord

Stuck on a code while creating a discord bot using python

Stuck on a code while creating a discord bot using python Question: this is the first time i am using this site. So, please do point out the mistake I did while writing this question. Thank you! Actually I am making a discord bot using python. I was planning to use it as a bot …

Total answers: 1

Bot posting embed 7 times

Bot posting embed 7 times Question: I have got this application bot and made some changes to it but everytime we finsh answering the questions the posts the embed 7 times as well as sending the "thank you" meaasage 7 times in the DM’s Im looking for the bug but can’t work it out, here …

Total answers: 1

discord.py's client.user.edit method generating error

discord.py's client.user.edit method generating error Question: I have created a discord price bot. It gets the price from the API and updates the nickname of my discord bot with that value. But I keep getting the error discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In username: You are changing your username or …

Total answers: 1

Getting the newest line added to a json and sending in discord.py

Getting the newest line added to a json and sending in discord.py Question: I am making a discord bot using discord.py and have a nice little setup so when I add something to my json file it checks every 20 seconds and if something has changed then it will send a discord embed with the …

Total answers: 2

Discord.py recognizing on_message client event, but IF statements not responding

Discord.py recognizing on_message client event, but IF statements not responding Question: I am working on a Discord bot and in this case want the bot to roll a 6 sided die when any user gives the "roll" command. See code below. Oddly enough this was working just fine, but now the print(worked) triggers and the …

Total answers: 1

How do I close my Discord bot after it sends a message?

How do I close my Discord bot after it sends a message? Question: I am using a bot to send a message in between a program, utilising it as a function. def sendmessage(message): @client.event async def on_ready(): print(f'{client.user} has connected to Discord!’) CHANNEL_ID = (ID) channel = client.get_channel(int(CHANNEL_ID)) await channel.send(message) print("sent") client.run(TOKEN) After it sends …

Total answers: 1

How can I make my discord bot generate a random number between 2 given values?

How can I make my discord bot generate a random number between 2 given values? Question: @bot.command(name=’randnum’) async def randnum(ctx, arg1, arg2): randnum = random.randint(*arg1, *arg2) await ctx.send(‘spinning…’) time.sleep(2) await ctx.send(‘your random number is’, randnum) arg1 and arg2 will be the numbers the user enters, then the bot picks a random one from between these …

Total answers: 1

Get a Gif File from URL and Send It via a Discord Bot

Get a Gif File from URL and Send It via a Discord Bot Question: I cannot figure out how to get this to work (maybe I’m just bad at programming). As the name suggests, I want to send an gif image with my Discord bot when I say “!radar”. The gif is located at https://radar.weather.gov/ridge/standard/CONUS_0.gif …

Total answers: 2

How can I fix my discord voice collecting bot?

How can I fix my discord voice collecting bot? Question: Hi I’m teaching speech lessons by discord, and I’m trying to make a bot which collects the voice of my students. import discord from discord.ext import commands from discord import FFmpegPCMAudio from pydub import AudioSegment import asyncio import os import subprocess intents = discord.Intents().all() client …

Total answers: 1