Automatically complete repetitive tasks in wizard101.
Project description
Discordbot
This package provides an interface to the RESTful and websocket Discord API so users don't have to worry about rate limits, asyncio, or error handling.
It's as simple as:
import discordbot as discord
bot = discord.Bot("my_api_token")
def on_message(raw_event, message):
print(message.author, "sent a message in", message.channel, "which said", message.content)
if message.content == "!ping":
bot.send_message(message.channel, "Pong!")
bot.on_event(discord.event.guild_message_sent, on_message)
bot.run()
discordbot also provides a simple way to add commands to your bot
import discordbot as discord
bot = discord.Bot("my_api_token")
role_moderator = '00000000000000' # the id of the role which is required to use the kick command
def cmd_kick(message, member, reason):
bot.kick(message.guild, member, reason)
bot.send_message(message.channel, "Member %s kicked. They are allowed to re-join. Ban them if you do not want this behavior." % member, reply_to = message, reply_ping = False)
bot.register_command("kick", "Temporarily remove someone from the server", cmd_kick, required_role = role_moderator, args = [
{
"name": "member",
"description": "The member to kick",
"type": "user"
},
{
"name": "reason",
"description": "Reason for kick",
"type": "string",
"default": None
}
])
bot.command_prefix = "!"
bot.register_default_commands() # (optional) adds !cmds and !ping
bot.run()
for more examples, please see this project on github
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
auto-wizard101-1.0.0.tar.gz
(105.2 kB
view details)
Built Distribution
File details
Details for the file auto-wizard101-1.0.0.tar.gz
.
File metadata
- Download URL: auto-wizard101-1.0.0.tar.gz
- Upload date:
- Size: 105.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ffe4664b7f5f57fabf9454478efee4419702251d6986b770069ebc77050fa3e |
|
MD5 | f41dfb44a5b66a521c179de7dadf2def |
|
BLAKE2b-256 | 843a004aaf068a7dbaef4533a0defb7289b58c1ba08d99ded2aa2015528e9369 |
File details
Details for the file auto_wizard101-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: auto_wizard101-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67fdf378b7234925c7f0415fa7c7029d94532f91c9cb1623e3c89ec0515e098f |
|
MD5 | 265f3294b9a4faefa7ea8eee92cee279 |
|
BLAKE2b-256 | 44ba989bd38d342ba1bd6d1d9f940ab8aae2227585eee91d13e1acd9e9467611 |