TomBot | A ChatOps robot for server operations | Chat library
kandi X-RAY | TomBot Summary
kandi X-RAY | TomBot Summary
A chat robot written in Python.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of TomBot
TomBot Key Features
TomBot Examples and Code Snippets
Community Discussions
Trending Discussions on TomBot
QUESTION
(Using Python 3.9)
So I'm making a bot called TomBot that is known as the loveable android for the series that this bot is made around. One of the items it will respond to is a compliment, and I want it to pick randomly from an array of responses for its actual response.
This all is fine, except I only want one (so far) of the responses inside the array to actually mention the user that posted the item. I thought I could simply move ctx.message.author.mention from client.say(random.choice(responses) + ", " + ctx.message.author.mention) into the array itself, separated from the custom strings. However I am getting a Syntax error when I do so. What am I missing?
...ANSWER
Answered 2021-Jan-14 at 19:10You're ending a string and trying to drop a variable in the middle, that won't work since it's inavlid syntax. What you want can be achieved with f strings like so:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install TomBot
You can use TomBot like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page