#๐Ÿ”’ My code just stops running..

30 messages ยท Page 1 of 1 (latest)

vast raftBOT
#

@cedar tide

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

sleek shadow
#

first = input("First: ")
second = input("Second: ")
sum = int(first) + int(second)
print (sum)

vast raftBOT
#

Hey @sleek shadow!

It looks like you're trying to paste code into this channel.

Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.

To do this, use the following method:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
sleek shadow
#

'''py
first = input("First: ")
second = input("Second: ")
sum = int(first) + int(second)
print (sum)

#

idk wht does this code not work

#

can you help ?

ripe shale
#

because its ` not ยด or '

#

!paste that here

vast raftBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

ripe shale
#

for readability or format it the right way

#

because the code is too long. so paste it instead

ripe shale
#

ye, let me see if i can help

#

can you give more details of why the bot stops?

#

while reviewing the code

#

does at least show that its online?

#

ah

#

couldn't find anything that may stop running the bot

#

I could try the code. but first, let me recommend something

#

instead of searching a whole channel for a embed that matchs the session id. save the message id to fetch it later

    session_statuses[session_id] = "Locked"
    
    # Fetch the embed from the specified channel
    channel = bot.get_channel(1210740382544171010)  # Change to your desired channel ID
    async for message in channel.history(limit=100):
        if message.embeds and message.embeds[0].footer.text.startswith(f"Session ID: {session_id}"):
            embed = message.embeds[0]
            # Update the status field in the embed to "Locked"
            embed.set_field_at(4, name="Status", value=session_statuses[session_id])
            # Edit the message with the updated embed
            await message.edit(embed=embed)
            await ctx.send("Session locked successfully.")
            return
#

!d discord.TextChannel.fetch_message maybe? they similier. so I won't be suprised if it worked

vast raftBOT
#

await fetch_message(id, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Retrieves a single [`Message`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Message) from the destination.
ripe shale
#

sorry for being late, but I have tried the code, the bot does come online

#

and the commands work fine

#

and you would need to reponse with at least a message or it going to tell you "The application did not respond"

#

what about locally?

#

in your computer?

#

can you show off how you running it?

vast raftBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.