Python Forum
Not able to add multiple channel IDs to python bot
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not able to add multiple channel IDs to python bot
#1
I have my bot setup so that it can ping a user in a specific channel when they join the server then immediately delete it, and it works:

command_prefix: "!"
# in seconds
delay_before_ping: 1
ghost_ping_channel: 899392291607822380 << that's the channel ID that I want the bot to post in

The issue I'm having:



When I try to add multiple channel IDs, it simply doesn't work. Am not very familiar with python, how could I add another channel ID? Using (), ", ', and other seperators doesn't seem to work. ID: ID seemed to work at first but gave me a list of errors and crashed the script when run.



New to python so really unsure what to do. Looked it up online however I may be using incorrect terminology as the information doesn't pop up.

NOTE: this is a config script to configure what channels the command runs in. The command works fine, but I'm having trouble configuring it.

Attached Files

Thumbnail(s)
   
Reply
#2
thats not how python work.

666+666*666/666-666
Reply
#3
(Oct-17-2021, 10:50 PM)Underscore Wrote: thats not how python work.

Bit confused, could you explain which part of what I was doing was incorrect or giving some context to which section of this I'm misexplaining?
Reply
#4
Likely you'll want to use a loop and loop through the various IDs. For example:

CHANNEL_IDS = [899392291607822380, 900403391607822380, (etc)]

for channel_id in CHANNEL_IDs:
    ghost_ping_channel: channel_id   # This command looks weird to me.  Are you sure this is the proper command????
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  python convert multiple files to multiple lists MCL169 6 1,568 Nov-25-2023, 05:31 AM
Last Post: Iqratech
  how to check if someone send a message in a discord channel? Zerolysimin 1 785 Nov-06-2022, 11:10 AM
Last Post: Larz60+
  Output from Paramiko exec_command from channel pemca 0 2,602 Dec-03-2021, 12:29 PM
Last Post: pemca
  Auto detect threshold for skin detection w/ HSV channel davlovsky 1 2,225 Oct-13-2019, 01:45 AM
Last Post: Larz60+
  pika channel.start_consuming() is not running sundar 0 2,422 Mar-20-2019, 06:28 AM
Last Post: sundar
  How to change TV channel with Python arsenal58 7 6,590 Nov-19-2018, 01:11 AM
Last Post: Larz60+
  AttributeError: type object 'MyClass' has no attribute 'channel' chris0147 2 8,753 Sep-29-2017, 06:16 PM
Last Post: chris0147
  ORA-03113: end-of-file on communication channel Python Cx_Oracle akansha 3 7,575 Nov-17-2016, 08:50 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020