xincord-plugins 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xincord/plugins/__init__.py +1 -0
- xincord/plugins/auto_role/__init__.py +25 -0
- xincord/plugins/auto_role/cog.py +115 -0
- xincord/plugins/auto_role/config.py +28 -0
- xincord/plugins/auto_role/config.yaml +9 -0
- xincord/plugins/bot_info/__init__.py +31 -0
- xincord/plugins/bot_info/cog.py +84 -0
- xincord/plugins/bot_info/config.py +25 -0
- xincord/plugins/bot_info/config.yaml +8 -0
- xincord/plugins/bot_info/lang/en-US/message/bot-info.yaml +20 -0
- xincord/plugins/bot_info/lang/en-US/register.yaml +3 -0
- xincord/plugins/bot_info/lang/zh-TW/message/bot-info.yaml +20 -0
- xincord/plugins/bot_info/lang/zh-TW/register.yaml +3 -0
- xincord/plugins/calculator/__init__.py +31 -0
- xincord/plugins/calculator/calculator.py +292 -0
- xincord/plugins/calculator/cog.py +114 -0
- xincord/plugins/calculator/lang/en-US/message/basic-calculate.yaml +14 -0
- xincord/plugins/calculator/lang/en-US/message/error.yaml +14 -0
- xincord/plugins/calculator/lang/en-US/register.yaml +7 -0
- xincord/plugins/calculator/lang/zh-TW/message/basic-calculate.yaml +14 -0
- xincord/plugins/calculator/lang/zh-TW/message/error.yaml +14 -0
- xincord/plugins/calculator/lang/zh-TW/register.yaml +7 -0
- xincord/plugins/chat_logger/__init__.py +46 -0
- xincord/plugins/chat_logger/cog.py +348 -0
- xincord/plugins/chat_logger/config.py +32 -0
- xincord/plugins/chat_logger/config.yaml +22 -0
- xincord/plugins/chat_logger/created.py +66 -0
- xincord/plugins/chat_logger/files.py +74 -0
- xincord/plugins/chat_logger/lang/en-US/message/chat-logger@setting.yaml +40 -0
- xincord/plugins/chat_logger/lang/en-US/message/delete.yaml +9 -0
- xincord/plugins/chat_logger/lang/en-US/message/modify-allow.yaml +19 -0
- xincord/plugins/chat_logger/lang/en-US/message/modify-block.yaml +19 -0
- xincord/plugins/chat_logger/lang/en-US/message/on-msg-delete.yaml +23 -0
- xincord/plugins/chat_logger/lang/en-US/message/on-msg-update.yaml +28 -0
- xincord/plugins/chat_logger/lang/en-US/placeholder.yaml +3 -0
- xincord/plugins/chat_logger/lang/en-US/register.yaml +8 -0
- xincord/plugins/chat_logger/lang/zh-TW/message/chat-logger@setting.yaml +40 -0
- xincord/plugins/chat_logger/lang/zh-TW/message/delete.yaml +9 -0
- xincord/plugins/chat_logger/lang/zh-TW/message/modify-allow.yaml +19 -0
- xincord/plugins/chat_logger/lang/zh-TW/message/modify-block.yaml +19 -0
- xincord/plugins/chat_logger/lang/zh-TW/message/on-msg-delete.yaml +23 -0
- xincord/plugins/chat_logger/lang/zh-TW/message/on-msg-update.yaml +27 -0
- xincord/plugins/chat_logger/lang/zh-TW/placeholder.yaml +3 -0
- xincord/plugins/chat_logger/lang/zh-TW/register.yaml +8 -0
- xincord/plugins/chat_logger/logs.py +83 -0
- xincord/plugins/chat_logger/messages.py +429 -0
- xincord/plugins/chat_logger/text.py +100 -0
- xincord/plugins/custom_commands/__init__.py +44 -0
- xincord/plugins/custom_commands/checks.py +106 -0
- xincord/plugins/custom_commands/cog.py +169 -0
- xincord/plugins/custom_commands/config.py +98 -0
- xincord/plugins/custom_commands/config.yaml +56 -0
- xincord/plugins/custom_commands/lang/zh-TW/message/chpytwtp-remit.yaml +18 -0
- xincord/plugins/custom_commands/lang/zh-TW/message/ctcb-none-card.yaml +17 -0
- xincord/plugins/custom_commands/lang/zh-TW/message/ctcb-remit.yaml +18 -0
- xincord/plugins/custom_commands/lang/zh-TW/message/cub-none-card.yaml +17 -0
- xincord/plugins/custom_commands/lang/zh-TW/message/tsib-none-card.yaml +17 -0
- xincord/plugins/dynamic_voice_channel/__init__.py +32 -0
- xincord/plugins/dynamic_voice_channel/cog.py +270 -0
- xincord/plugins/dynamic_voice_channel/lang/en-US/message/bind-success.yaml +4 -0
- xincord/plugins/dynamic_voice_channel/lang/en-US/message/must-under-category.yaml +4 -0
- xincord/plugins/dynamic_voice_channel/lang/en-US/message/unbind-fail.yaml +4 -0
- xincord/plugins/dynamic_voice_channel/lang/en-US/message/unbind-success.yaml +4 -0
- xincord/plugins/dynamic_voice_channel/lang/en-US/register.yaml +21 -0
- xincord/plugins/dynamic_voice_channel/lang/zh-TW/message/bind-success.yaml +4 -0
- xincord/plugins/dynamic_voice_channel/lang/zh-TW/message/must-under-category.yaml +4 -0
- xincord/plugins/dynamic_voice_channel/lang/zh-TW/message/unbind-fail.yaml +4 -0
- xincord/plugins/dynamic_voice_channel/lang/zh-TW/message/unbind-success.yaml +4 -0
- xincord/plugins/dynamic_voice_channel/lang/zh-TW/register.yaml +21 -0
- xincord/plugins/dynamic_voice_channel/names.py +39 -0
- xincord/plugins/dynamic_voice_channel/rooms.py +209 -0
- xincord/plugins/dynamic_voice_channel/store.py +224 -0
- xincord/plugins/economy/__init__.py +40 -0
- xincord/plugins/economy/cog.py +289 -0
- xincord/plugins/economy/config.py +25 -0
- xincord/plugins/economy/config.yaml +12 -0
- xincord/plugins/economy/lang/en-US/message/add-cost.yaml +15 -0
- xincord/plugins/economy/lang/en-US/message/add-money.yaml +15 -0
- xincord/plugins/economy/lang/en-US/message/balance.yaml +15 -0
- xincord/plugins/economy/lang/en-US/message/no-permission.yaml +9 -0
- xincord/plugins/economy/lang/en-US/message/remove-cost.yaml +15 -0
- xincord/plugins/economy/lang/en-US/message/remove-money.yaml +15 -0
- xincord/plugins/economy/lang/en-US/message/set-cost.yaml +15 -0
- xincord/plugins/economy/lang/en-US/message/set-money.yaml +15 -0
- xincord/plugins/economy/lang/en-US/message/top-cost.yaml +9 -0
- xincord/plugins/economy/lang/en-US/message/top-money.yaml +9 -0
- xincord/plugins/economy/lang/en-US/register.yaml +81 -0
- xincord/plugins/economy/lang/zh-TW/message/add-cost.yaml +15 -0
- xincord/plugins/economy/lang/zh-TW/message/add-money.yaml +15 -0
- xincord/plugins/economy/lang/zh-TW/message/balance.yaml +15 -0
- xincord/plugins/economy/lang/zh-TW/message/no-permission.yaml +9 -0
- xincord/plugins/economy/lang/zh-TW/message/remove-cost.yaml +15 -0
- xincord/plugins/economy/lang/zh-TW/message/remove-money.yaml +15 -0
- xincord/plugins/economy/lang/zh-TW/message/set-cost.yaml +15 -0
- xincord/plugins/economy/lang/zh-TW/message/set-money.yaml +15 -0
- xincord/plugins/economy/lang/zh-TW/message/top-cost.yaml +9 -0
- xincord/plugins/economy/lang/zh-TW/message/top-money.yaml +9 -0
- xincord/plugins/economy/lang/zh-TW/register.yaml +81 -0
- xincord/plugins/economy/store.py +102 -0
- xincord/plugins/economy/wallet.py +74 -0
- xincord/plugins/example/__init__.py +37 -0
- xincord/plugins/example/cog.py +105 -0
- xincord/plugins/example/config.py +12 -0
- xincord/plugins/example/config.yaml +4 -0
- xincord/plugins/example/lang/en-US/message/counter.yaml +10 -0
- xincord/plugins/example/lang/en-US/message/example.yaml +19 -0
- xincord/plugins/example/lang/en-US/register.yaml +10 -0
- xincord/plugins/example/lang/zh-TW/message/counter.yaml +10 -0
- xincord/plugins/example/lang/zh-TW/message/example.yaml +19 -0
- xincord/plugins/example/lang/zh-TW/register.yaml +10 -0
- xincord/plugins/failures/__init__.py +47 -0
- xincord/plugins/feedback/__init__.py +35 -0
- xincord/plugins/feedback/cog.py +315 -0
- xincord/plugins/feedback/config.py +30 -0
- xincord/plugins/feedback/config.yaml +14 -0
- xincord/plugins/feedback/form.py +45 -0
- xincord/plugins/feedback/lang/en-US/message/ask-message.yaml +54 -0
- xincord/plugins/feedback/lang/en-US/message/print-result.yaml +12 -0
- xincord/plugins/feedback/lang/en-US/modal/fill-form.yaml +14 -0
- xincord/plugins/feedback/lang/en-US/register.yaml +10 -0
- xincord/plugins/feedback/lang/zh-TW/message/ask-message.yaml +54 -0
- xincord/plugins/feedback/lang/zh-TW/message/print-result.yaml +12 -0
- xincord/plugins/feedback/lang/zh-TW/modal/fill-form.yaml +14 -0
- xincord/plugins/feedback/lang/zh-TW/register.yaml +10 -0
- xincord/plugins/giveaway/__init__.py +36 -0
- xincord/plugins/giveaway/channels.py +74 -0
- xincord/plugins/giveaway/cog.py +663 -0
- xincord/plugins/giveaway/config.py +59 -0
- xincord/plugins/giveaway/config.yaml +12 -0
- xincord/plugins/giveaway/drafts.py +94 -0
- xincord/plugins/giveaway/inputs.py +107 -0
- xincord/plugins/giveaway/lang/en-US/message/auto-draw-result.yaml +1 -0
- xincord/plugins/giveaway/lang/en-US/message/create-cancelled.yaml +1 -0
- xincord/plugins/giveaway/lang/en-US/message/create-failed.yaml +1 -0
- xincord/plugins/giveaway/lang/en-US/message/create-finished.yaml +1 -0
- xincord/plugins/giveaway/lang/en-US/message/create-giveaway.yaml +71 -0
- xincord/plugins/giveaway/lang/en-US/message/draw-result.yaml +1 -0
- xincord/plugins/giveaway/lang/en-US/message/giveaway-post.yaml +9 -0
- xincord/plugins/giveaway/lang/en-US/modal/add-prize.yaml +18 -0
- xincord/plugins/giveaway/lang/en-US/modal/set-description.yaml +12 -0
- xincord/plugins/giveaway/lang/en-US/modal/set-end-time.yaml +11 -0
- xincord/plugins/giveaway/lang/en-US/modal/set-sponsor.yaml +12 -0
- xincord/plugins/giveaway/lang/en-US/modal/set-thumbnail.yaml +12 -0
- xincord/plugins/giveaway/lang/en-US/modal/set-title.yaml +11 -0
- xincord/plugins/giveaway/lang/en-US/register.yaml +3 -0
- xincord/plugins/giveaway/lang/en-US/text.yaml +76 -0
- xincord/plugins/giveaway/lang/zh-TW/message/auto-draw-result.yaml +1 -0
- xincord/plugins/giveaway/lang/zh-TW/message/create-cancelled.yaml +1 -0
- xincord/plugins/giveaway/lang/zh-TW/message/create-failed.yaml +1 -0
- xincord/plugins/giveaway/lang/zh-TW/message/create-finished.yaml +1 -0
- xincord/plugins/giveaway/lang/zh-TW/message/create-giveaway.yaml +71 -0
- xincord/plugins/giveaway/lang/zh-TW/message/draw-result.yaml +1 -0
- xincord/plugins/giveaway/lang/zh-TW/message/giveaway-post.yaml +9 -0
- xincord/plugins/giveaway/lang/zh-TW/modal/add-prize.yaml +18 -0
- xincord/plugins/giveaway/lang/zh-TW/modal/set-description.yaml +12 -0
- xincord/plugins/giveaway/lang/zh-TW/modal/set-end-time.yaml +11 -0
- xincord/plugins/giveaway/lang/zh-TW/modal/set-sponsor.yaml +12 -0
- xincord/plugins/giveaway/lang/zh-TW/modal/set-thumbnail.yaml +12 -0
- xincord/plugins/giveaway/lang/zh-TW/modal/set-title.yaml +11 -0
- xincord/plugins/giveaway/lang/zh-TW/register.yaml +3 -0
- xincord/plugins/giveaway/lang/zh-TW/text.yaml +76 -0
- xincord/plugins/giveaway/model.py +317 -0
- xincord/plugins/giveaway/store.py +152 -0
- xincord/plugins/giveaway/texts.py +236 -0
- xincord/plugins/giveaway/times.py +53 -0
- xincord/plugins/listen_channels/__init__.py +6 -0
- xincord/plugins/listen_channels/menu.py +286 -0
- xincord/plugins/listen_channels/settings.py +97 -0
- xincord/plugins/listen_channels/store.py +231 -0
- xincord/plugins/music_player/__init__.py +42 -0
- xincord/plugins/music_player/audio.py +148 -0
- xincord/plugins/music_player/buttons.py +108 -0
- xincord/plugins/music_player/cog.py +225 -0
- xincord/plugins/music_player/commands.py +400 -0
- xincord/plugins/music_player/config.py +77 -0
- xincord/plugins/music_player/config.yaml +39 -0
- xincord/plugins/music_player/display.py +230 -0
- xincord/plugins/music_player/emojis.py +43 -0
- xincord/plugins/music_player/history.py +151 -0
- xincord/plugins/music_player/ids.py +7 -0
- xincord/plugins/music_player/lang/en-US/message/now-playing.yaml +57 -0
- xincord/plugins/music_player/lang/en-US/message/pause.yaml +57 -0
- xincord/plugins/music_player/lang/en-US/message/play.yaml +57 -0
- xincord/plugins/music_player/lang/en-US/message/queue.yaml +55 -0
- xincord/plugins/music_player/lang/en-US/message/resume.yaml +57 -0
- xincord/plugins/music_player/lang/en-US/message/skip.yaml +57 -0
- xincord/plugins/music_player/lang/en-US/message/volume.yaml +5 -0
- xincord/plugins/music_player/lang/en-US/register.yaml +45 -0
- xincord/plugins/music_player/lang/en-US/text.yaml +46 -0
- xincord/plugins/music_player/lang/zh-TW/message/now-playing.yaml +57 -0
- xincord/plugins/music_player/lang/zh-TW/message/pause.yaml +57 -0
- xincord/plugins/music_player/lang/zh-TW/message/play.yaml +57 -0
- xincord/plugins/music_player/lang/zh-TW/message/queue.yaml +55 -0
- xincord/plugins/music_player/lang/zh-TW/message/resume.yaml +57 -0
- xincord/plugins/music_player/lang/zh-TW/message/skip.yaml +57 -0
- xincord/plugins/music_player/lang/zh-TW/message/volume.yaml +5 -0
- xincord/plugins/music_player/lang/zh-TW/register.yaml +56 -0
- xincord/plugins/music_player/lang/zh-TW/text.yaml +46 -0
- xincord/plugins/music_player/node.py +364 -0
- xincord/plugins/music_player/panels.py +153 -0
- xincord/plugins/music_player/replies.py +183 -0
- xincord/plugins/music_player/session.py +244 -0
- xincord/plugins/music_player/texts.py +36 -0
- xincord/plugins/ntust_announcements/__init__.py +26 -0
- xincord/plugins/ntust_announcements/api.py +124 -0
- xincord/plugins/ntust_announcements/cog.py +254 -0
- xincord/plugins/ntust_announcements/config.py +313 -0
- xincord/plugins/ntust_announcements/config.yaml +195 -0
- xincord/plugins/ntust_announcements/conversion.py +295 -0
- xincord/plugins/ntust_announcements/markup.py +474 -0
- xincord/plugins/ntust_announcements/messages.py +151 -0
- xincord/plugins/ntust_announcements/pages.py +133 -0
- xincord/plugins/ntust_announcements/store.py +163 -0
- xincord/plugins/ntust_announcements/strings.py +22 -0
- xincord/plugins/ntust_announcements/watch.py +368 -0
- xincord/plugins/ntust_announcements/web.py +125 -0
- xincord/plugins/ntust_course_watch/__init__.py +31 -0
- xincord/plugins/ntust_course_watch/alerts.py +109 -0
- xincord/plugins/ntust_course_watch/cog.py +259 -0
- xincord/plugins/ntust_course_watch/config.py +42 -0
- xincord/plugins/ntust_course_watch/config.yaml +20 -0
- xincord/plugins/ntust_course_watch/courses.py +137 -0
- xincord/plugins/ntust_course_watch/lang/en-US/register.yaml +20 -0
- xincord/plugins/ntust_course_watch/lang/en-US/text.yaml +20 -0
- xincord/plugins/ntust_course_watch/lang/zh-TW/register.yaml +21 -0
- xincord/plugins/ntust_course_watch/lang/zh-TW/text.yaml +21 -0
- xincord/plugins/ntust_course_watch/store.py +201 -0
- xincord/plugins/ntust_course_watch/texts.py +37 -0
- xincord/plugins/ntust_course_watch/watch.py +183 -0
- xincord/plugins/ntust_course_watch/web.py +86 -0
- xincord/plugins/ntust_tls/__init__.py +29 -0
- xincord/plugins/ntust_tls/twca-secure-ssl-ca.pem +37 -0
- xincord/plugins/py.typed +0 -0
- xincord/plugins/redaction/__init__.py +80 -0
- xincord/plugins/ticket/__init__.py +37 -0
- xincord/plugins/ticket/archive.py +274 -0
- xincord/plugins/ticket/channels.py +300 -0
- xincord/plugins/ticket/cog.py +733 -0
- xincord/plugins/ticket/controls.py +423 -0
- xincord/plugins/ticket/drafts.py +81 -0
- xincord/plugins/ticket/ids.py +12 -0
- xincord/plugins/ticket/lang/en-US/message/add-ticket.yaml +47 -0
- xincord/plugins/ticket/lang/en-US/message/confirm-add.yaml +7 -0
- xincord/plugins/ticket/lang/en-US/message/confirm-create.yaml +7 -0
- xincord/plugins/ticket/lang/en-US/message/create-ticket.yaml +65 -0
- xincord/plugins/ticket/lang/en-US/message/modify-admin-role.yaml +23 -0
- xincord/plugins/ticket/lang/en-US/message/modify-btn-color.yaml +46 -0
- xincord/plugins/ticket/lang/en-US/message/modify-category.yaml +33 -0
- xincord/plugins/ticket/lang/en-US/modal/modify-author.yaml +20 -0
- xincord/plugins/ticket/lang/en-US/modal/modify-btn-text.yaml +19 -0
- xincord/plugins/ticket/lang/en-US/modal/modify-content.yaml +20 -0
- xincord/plugins/ticket/lang/en-US/modal/modify-embed-color.yaml +11 -0
- xincord/plugins/ticket/lang/en-US/modal/modify-reason-title.yaml +11 -0
- xincord/plugins/ticket/lang/en-US/modal/press-ticket.yaml +9 -0
- xincord/plugins/ticket/lang/en-US/modal/preview-reason.yaml +8 -0
- xincord/plugins/ticket/lang/en-US/register.yaml +11 -0
- xincord/plugins/ticket/lang/en-US/text.yaml +60 -0
- xincord/plugins/ticket/lang/zh-TW/message/add-ticket.yaml +47 -0
- xincord/plugins/ticket/lang/zh-TW/message/confirm-add.yaml +7 -0
- xincord/plugins/ticket/lang/zh-TW/message/confirm-create.yaml +7 -0
- xincord/plugins/ticket/lang/zh-TW/message/create-ticket.yaml +65 -0
- xincord/plugins/ticket/lang/zh-TW/message/modify-admin-role.yaml +23 -0
- xincord/plugins/ticket/lang/zh-TW/message/modify-btn-color.yaml +45 -0
- xincord/plugins/ticket/lang/zh-TW/message/modify-category.yaml +33 -0
- xincord/plugins/ticket/lang/zh-TW/modal/modify-author.yaml +20 -0
- xincord/plugins/ticket/lang/zh-TW/modal/modify-btn-text.yaml +19 -0
- xincord/plugins/ticket/lang/zh-TW/modal/modify-content.yaml +20 -0
- xincord/plugins/ticket/lang/zh-TW/modal/modify-embed-color.yaml +11 -0
- xincord/plugins/ticket/lang/zh-TW/modal/modify-reason-title.yaml +11 -0
- xincord/plugins/ticket/lang/zh-TW/modal/press-ticket.yaml +9 -0
- xincord/plugins/ticket/lang/zh-TW/modal/preview-reason.yaml +8 -0
- xincord/plugins/ticket/lang/zh-TW/register.yaml +11 -0
- xincord/plugins/ticket/lang/zh-TW/text.yaml +60 -0
- xincord/plugins/ticket/model.py +114 -0
- xincord/plugins/ticket/store.py +121 -0
- xincord/plugins/ticket/targets.py +79 -0
- xincord/plugins/ticket/texts.py +67 -0
- xincord/plugins/ticket/tickets.py +100 -0
- xincord/plugins/ticket/views.py +113 -0
- xincord/plugins/ticket_away_notice/__init__.py +33 -0
- xincord/plugins/ticket_away_notice/cog.py +305 -0
- xincord/plugins/ticket_away_notice/config.py +35 -0
- xincord/plugins/ticket_away_notice/config.yaml +22 -0
- xincord/plugins/ticket_away_notice/lang/zh-TW/message/not-online.yaml +9 -0
- xincord/plugins/uptime_heartbeat/__init__.py +25 -0
- xincord/plugins/uptime_heartbeat/cog.py +61 -0
- xincord/plugins/uptime_heartbeat/config.py +54 -0
- xincord/plugins/uptime_heartbeat/config.yaml +11 -0
- xincord/plugins/uptime_heartbeat/pusher.py +199 -0
- xincord/plugins/voice_logger/__init__.py +40 -0
- xincord/plugins/voice_logger/cog.py +237 -0
- xincord/plugins/voice_logger/lang/en-US/message/delete.yaml +9 -0
- xincord/plugins/voice_logger/lang/en-US/message/modify-allow.yaml +11 -0
- xincord/plugins/voice_logger/lang/en-US/message/modify-block.yaml +11 -0
- xincord/plugins/voice_logger/lang/en-US/message/on-channel-join.yaml +18 -0
- xincord/plugins/voice_logger/lang/en-US/message/on-channel-left.yaml +18 -0
- xincord/plugins/voice_logger/lang/en-US/message/on-channel-switch.yaml +24 -0
- xincord/plugins/voice_logger/lang/en-US/message/on-status-delete.yaml +21 -0
- xincord/plugins/voice_logger/lang/en-US/message/on-status-new.yaml +22 -0
- xincord/plugins/voice_logger/lang/en-US/message/on-status-update.yaml +24 -0
- xincord/plugins/voice_logger/lang/en-US/message/voice-logger@setting.yaml +40 -0
- xincord/plugins/voice_logger/lang/en-US/placeholder.yaml +3 -0
- xincord/plugins/voice_logger/lang/en-US/register.yaml +8 -0
- xincord/plugins/voice_logger/lang/zh-TW/message/delete.yaml +9 -0
- xincord/plugins/voice_logger/lang/zh-TW/message/modify-allow.yaml +11 -0
- xincord/plugins/voice_logger/lang/zh-TW/message/modify-block.yaml +11 -0
- xincord/plugins/voice_logger/lang/zh-TW/message/on-channel-join.yaml +18 -0
- xincord/plugins/voice_logger/lang/zh-TW/message/on-channel-left.yaml +18 -0
- xincord/plugins/voice_logger/lang/zh-TW/message/on-channel-switch.yaml +24 -0
- xincord/plugins/voice_logger/lang/zh-TW/message/on-status-delete.yaml +21 -0
- xincord/plugins/voice_logger/lang/zh-TW/message/on-status-new.yaml +21 -0
- xincord/plugins/voice_logger/lang/zh-TW/message/on-status-update.yaml +24 -0
- xincord/plugins/voice_logger/lang/zh-TW/message/voice-logger@setting.yaml +40 -0
- xincord/plugins/voice_logger/lang/zh-TW/placeholder.yaml +3 -0
- xincord/plugins/voice_logger/lang/zh-TW/register.yaml +8 -0
- xincord/plugins/voice_logger/logs.py +92 -0
- xincord/plugins/voice_logger/status.py +131 -0
- xincord/plugins/welcome_goodbye/__init__.py +33 -0
- xincord/plugins/welcome_goodbye/cog.py +302 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/bye-bind-already.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/bye-bind-success.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/bye-unbind-empty.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/bye-unbind-success.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/bye.yaml +10 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/guild-only.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/invalid-channel.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/no-permission.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/welcome-bind-already.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/welcome-bind-success.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/welcome-unbind-empty.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/welcome-unbind-success.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/en-US/message/welcome.yaml +13 -0
- xincord/plugins/welcome_goodbye/lang/en-US/register.yaml +23 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/bye-bind-already.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/bye-bind-success.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/bye-unbind-empty.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/bye-unbind-success.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/bye.yaml +10 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/guild-only.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/invalid-channel.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/no-permission.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/welcome-bind-already.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/welcome-bind-success.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/welcome-unbind-empty.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/welcome-unbind-success.yaml +1 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/message/welcome.yaml +13 -0
- xincord/plugins/welcome_goodbye/lang/zh-TW/register.yaml +23 -0
- xincord/plugins/welcome_goodbye/store.py +78 -0
- xincord/plugins/welcome_goodbye/values.py +160 -0
- xincord_plugins-1.0.0.dist-info/METADATA +11 -0
- xincord_plugins-1.0.0.dist-info/RECORD +354 -0
- xincord_plugins-1.0.0.dist-info/WHEEL +4 -0
- xincord_plugins-1.0.0.dist-info/entry_points.txt +20 -0
- xincord_plugins-1.0.0.dist-info/licenses/LICENSE +660 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""The official xincord plugins, one subpackage per plugin."""
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""AutoRole: members who join a configured guild get that guild's roles."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
import discord
|
|
6
|
+
|
|
7
|
+
from .cog import AutoRole
|
|
8
|
+
from .config import Config
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from xincord.core.bot import Bot
|
|
12
|
+
|
|
13
|
+
DEPENDS: tuple[str, ...] = ()
|
|
14
|
+
SOFT_DEPENDS: tuple[str, ...] = ()
|
|
15
|
+
# Member joins need the privileged members intent.
|
|
16
|
+
INTENTS = discord.Intents(members=True)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
async def setup(bot: Bot) -> None:
|
|
20
|
+
"""Load the config and add the cog.
|
|
21
|
+
|
|
22
|
+
The plugin has no lang files: it has no text.
|
|
23
|
+
"""
|
|
24
|
+
context = bot.plugin_context(__name__)
|
|
25
|
+
await bot.add_cog(AutoRole(bot, context.config(Config)))
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"""The listeners that give members who join a configured guild its roles."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
from typing import TYPE_CHECKING, override
|
|
5
|
+
|
|
6
|
+
import discord
|
|
7
|
+
from discord.ext import commands
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from collections.abc import Iterable
|
|
11
|
+
|
|
12
|
+
from .config import Config
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class AutoRole(commands.Cog):
|
|
18
|
+
"""The plugin's state and listeners; ``setup`` adds them."""
|
|
19
|
+
|
|
20
|
+
def __init__(self, bot: commands.Bot, config: Config) -> None:
|
|
21
|
+
"""Keep the bot and each configured guild's role IDs.
|
|
22
|
+
|
|
23
|
+
A reload builds a new cog, so the guilds and their roles change together.
|
|
24
|
+
"""
|
|
25
|
+
self.bot = bot
|
|
26
|
+
self.roles = config.roles_by_guild()
|
|
27
|
+
|
|
28
|
+
@override
|
|
29
|
+
async def cog_load(self) -> None:
|
|
30
|
+
"""Check the config at once when the plugin loads into a ready bot, as on a reload."""
|
|
31
|
+
if self.bot.is_ready():
|
|
32
|
+
self.check()
|
|
33
|
+
|
|
34
|
+
@commands.Cog.listener()
|
|
35
|
+
async def on_ready(self) -> None:
|
|
36
|
+
"""Check the config once the guilds are known; discord.py fires this per session."""
|
|
37
|
+
self.check()
|
|
38
|
+
|
|
39
|
+
def check(self) -> None:
|
|
40
|
+
"""Log what keeps each configured guild's roles from being given."""
|
|
41
|
+
for guild_id, role_ids in self.roles.items():
|
|
42
|
+
guild = self.bot.get_guild(guild_id)
|
|
43
|
+
if guild is None:
|
|
44
|
+
logger.warning(
|
|
45
|
+
"AutoRole gives no roles in guild %s: the bot is not in it", guild_id
|
|
46
|
+
)
|
|
47
|
+
continue
|
|
48
|
+
if guild.unavailable: # an outage: no roles or members are known, and none can join
|
|
49
|
+
continue
|
|
50
|
+
_can_manage_roles(guild)
|
|
51
|
+
_givable(guild, role_ids)
|
|
52
|
+
|
|
53
|
+
@commands.Cog.listener()
|
|
54
|
+
async def on_member_join(self, member: discord.Member) -> None:
|
|
55
|
+
"""Give a member who joined a configured guild that guild's roles, one by one.
|
|
56
|
+
|
|
57
|
+
discord.py builds the member from the join event, so no member cache is needed.
|
|
58
|
+
"""
|
|
59
|
+
guild = member.guild
|
|
60
|
+
role_ids = self.roles.get(guild.id)
|
|
61
|
+
if role_ids is None or not _can_manage_roles(guild):
|
|
62
|
+
return
|
|
63
|
+
for role in _givable(guild, role_ids):
|
|
64
|
+
try:
|
|
65
|
+
# discord.py's atomic add sends one add-role request, which keeps the member's
|
|
66
|
+
# other roles.
|
|
67
|
+
await member.add_roles(role)
|
|
68
|
+
except discord.HTTPException as error:
|
|
69
|
+
logger.warning(
|
|
70
|
+
"AutoRole could not give role %s (%s) to %s (%s) in %s (%s): %s",
|
|
71
|
+
role.name,
|
|
72
|
+
role.id,
|
|
73
|
+
member.name,
|
|
74
|
+
member.id,
|
|
75
|
+
guild.name,
|
|
76
|
+
guild.id,
|
|
77
|
+
error,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def _can_manage_roles(guild: discord.Guild) -> bool:
|
|
82
|
+
"""Whether the bot has Manage Roles in ``guild``; log a warning if it does not."""
|
|
83
|
+
if guild.me.guild_permissions.manage_roles:
|
|
84
|
+
return True
|
|
85
|
+
logger.warning(
|
|
86
|
+
"AutoRole gives no roles in %s (%s): the bot lacks Manage Roles", guild.name, guild.id
|
|
87
|
+
)
|
|
88
|
+
return False
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _givable(guild: discord.Guild, role_ids: Iterable[int]) -> list[discord.Role]:
|
|
92
|
+
"""Return the roles of ``role_ids`` that the bot can give in ``guild``, each once.
|
|
93
|
+
|
|
94
|
+
Roles are looked up in ``guild`` at each call. Each role that is missing or that the bot
|
|
95
|
+
cannot give is logged and left out; the others are still given.
|
|
96
|
+
"""
|
|
97
|
+
roles: list[discord.Role] = []
|
|
98
|
+
for role_id in dict.fromkeys(role_ids):
|
|
99
|
+
role = guild.get_role(role_id)
|
|
100
|
+
if role is None:
|
|
101
|
+
logger.warning(
|
|
102
|
+
"AutoRole skips role %s: it is not in %s (%s)", role_id, guild.name, guild.id
|
|
103
|
+
)
|
|
104
|
+
elif not role.is_assignable(): # Discord's rules, checked before any request
|
|
105
|
+
logger.warning(
|
|
106
|
+
"AutoRole skips role %s (%s) in %s (%s): it is managed, @everyone or not below "
|
|
107
|
+
"the bot's highest role",
|
|
108
|
+
role.name,
|
|
109
|
+
role.id,
|
|
110
|
+
guild.name,
|
|
111
|
+
guild.id,
|
|
112
|
+
)
|
|
113
|
+
else:
|
|
114
|
+
roles.append(role)
|
|
115
|
+
return roles
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""The plugin's ``config.yaml``."""
|
|
2
|
+
|
|
3
|
+
from typing import Annotated
|
|
4
|
+
|
|
5
|
+
from pydantic import Field, PositiveInt
|
|
6
|
+
|
|
7
|
+
from xincord.core.config import Model
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class GuildRoles(Model):
|
|
11
|
+
"""A guild and the roles that its new members get."""
|
|
12
|
+
|
|
13
|
+
guild_id: PositiveInt
|
|
14
|
+
# Any integers: an ID that names no role is skipped at the join.
|
|
15
|
+
role_ids: Annotated[tuple[int, ...], Field(min_length=1)]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Config(Model):
|
|
19
|
+
"""``plugins/AutoRole/config.yaml``; the bundled ``config.yaml`` lists no guilds.
|
|
20
|
+
|
|
21
|
+
The core config's ``plugins`` list enables the plugin; an ``enabled`` key here only warns.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
guilds: tuple[GuildRoles, ...] # required
|
|
25
|
+
|
|
26
|
+
def roles_by_guild(self) -> dict[int, tuple[int, ...]]:
|
|
27
|
+
"""Map each guild ID to its role IDs; a guild listed twice keeps its last entry."""
|
|
28
|
+
return {entry.guild_id: entry.role_ids for entry in self.guilds}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# AutoRole: list it under `plugins` in the core config.yaml to enable it. The bot then needs the
|
|
2
|
+
# Server Members intent, allowed for it in the Discord developer portal.
|
|
3
|
+
|
|
4
|
+
# Members who join one of these guilds get its roles. In each guild, the bot needs the Manage Roles
|
|
5
|
+
# permission, and its highest role must be above these roles.
|
|
6
|
+
# Example:
|
|
7
|
+
# - guild_id: 111111111111111111
|
|
8
|
+
# role_ids: [222222222222222222, 333333333333333333]
|
|
9
|
+
guilds: []
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""BotInfo: ``/bot-info`` shows the bot's guild and member counts and a link to its source code."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
import discord
|
|
6
|
+
|
|
7
|
+
from xincord.core.templates import Templates
|
|
8
|
+
|
|
9
|
+
from .cog import BotInfo
|
|
10
|
+
from .config import Config
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from xincord.core.bot import Bot
|
|
14
|
+
|
|
15
|
+
DEPENDS: tuple[str, ...] = ()
|
|
16
|
+
SOFT_DEPENDS: tuple[str, ...] = ()
|
|
17
|
+
# discord.py keeps each guild's member count current from member join and leave events, which need
|
|
18
|
+
# the privileged members intent.
|
|
19
|
+
INTENTS = discord.Intents(members=True)
|
|
20
|
+
# Replies use the user's locale and fall back to this one.
|
|
21
|
+
DEFAULT_LOCALE = "zh-TW"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
async def setup(bot: Bot) -> None:
|
|
25
|
+
"""Load the config, the lang files and the templates, then add the cog and its command."""
|
|
26
|
+
context = bot.plugin_context(__name__)
|
|
27
|
+
lang = context.lang(DEFAULT_LOCALE)
|
|
28
|
+
cog = BotInfo(context.config(Config), lang, Templates.load(lang))
|
|
29
|
+
await bot.add_cog(cog)
|
|
30
|
+
# A global command; discord.py removes it when the plugin unloads.
|
|
31
|
+
bot.tree.add_command(cog.command())
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""The /bot-info command and its reply."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING, Any, Protocol
|
|
4
|
+
|
|
5
|
+
import discord
|
|
6
|
+
from discord import app_commands
|
|
7
|
+
from discord.ext import commands
|
|
8
|
+
|
|
9
|
+
from xincord.core.placeholders import global_values
|
|
10
|
+
from xincord.core.templates import render_message
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from collections.abc import Collection
|
|
14
|
+
|
|
15
|
+
from xincord.core.i18n import Lang
|
|
16
|
+
from xincord.core.templates import Templates
|
|
17
|
+
|
|
18
|
+
from .config import Config
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Counted(Protocol):
|
|
22
|
+
"""A guild as the counts see it; ``discord.Guild`` is one."""
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def member_count(self) -> int | None:
|
|
26
|
+
"""The guild's member count, or None when Discord has not sent it."""
|
|
27
|
+
...
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class BotInfo(commands.Cog):
|
|
31
|
+
"""The plugin's state and handlers; ``setup`` registers them."""
|
|
32
|
+
|
|
33
|
+
def __init__(self, config: Config, lang: Lang, templates: Templates) -> None:
|
|
34
|
+
"""Keep what ``setup`` loaded."""
|
|
35
|
+
self.config = config
|
|
36
|
+
self.lang = lang
|
|
37
|
+
self.templates = templates
|
|
38
|
+
|
|
39
|
+
def command(self) -> app_commands.Command[Any, ..., None]:
|
|
40
|
+
"""Build the global ``/bot-info``, localized from ``register.yaml``.
|
|
41
|
+
|
|
42
|
+
The command is usable in guilds and in the bot's DMs, and installed with guilds.
|
|
43
|
+
discord.py sends no contexts or install types unless they are set, which would leave them
|
|
44
|
+
to Discord, so the command sets them.
|
|
45
|
+
"""
|
|
46
|
+
lang = self.lang
|
|
47
|
+
command: app_commands.Command[Any, ..., None] = app_commands.Command(
|
|
48
|
+
name=lang.command("bot-info", "bot-info.name"),
|
|
49
|
+
description=lang.command("show about the bot data", "bot-info.description"),
|
|
50
|
+
callback=self.bot_info,
|
|
51
|
+
allowed_contexts=app_commands.AppCommandContext(
|
|
52
|
+
guild=True, dm_channel=True, private_channel=False
|
|
53
|
+
),
|
|
54
|
+
allowed_installs=app_commands.AppInstallationType(guild=True, user=False),
|
|
55
|
+
extras={"global": True}, # a global command
|
|
56
|
+
)
|
|
57
|
+
return command
|
|
58
|
+
|
|
59
|
+
async def bot_info(self, interaction: discord.Interaction) -> None:
|
|
60
|
+
"""Turn the deferred response into the ``bot-info`` embed, with the counts as they are now.
|
|
61
|
+
|
|
62
|
+
The counts belong to this render only, not to placeholders that every plugin shares.
|
|
63
|
+
"""
|
|
64
|
+
guild_count, member_count = counts(interaction.client.guilds)
|
|
65
|
+
values = global_values(interaction.client) | {
|
|
66
|
+
"guild_counts": str(guild_count),
|
|
67
|
+
"member_counts": str(member_count),
|
|
68
|
+
"source_url": self.config.source_url,
|
|
69
|
+
}
|
|
70
|
+
message = self.templates.message("bot-info", interaction.locale.value)
|
|
71
|
+
reply = render_message(message, values)
|
|
72
|
+
# The command tree deferred the response ephemerally.
|
|
73
|
+
await interaction.edit_original_response(
|
|
74
|
+
content=reply.content, embeds=reply.embeds, view=reply.view
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def counts(guilds: Collection[Counted]) -> tuple[int, int]:
|
|
79
|
+
"""Return the number of ``guilds`` and the sum of their member counts.
|
|
80
|
+
|
|
81
|
+
A user in several guilds counts once per guild, and bots count. An unknown member
|
|
82
|
+
count (a guild unavailable since the bot connected) adds nothing.
|
|
83
|
+
"""
|
|
84
|
+
return len(guilds), sum(guild.member_count or 0 for guild in guilds)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""The plugin's ``config.yaml``."""
|
|
2
|
+
|
|
3
|
+
from typing import Annotated
|
|
4
|
+
|
|
5
|
+
from pydantic import StringConstraints
|
|
6
|
+
|
|
7
|
+
from xincord.core.config import Model
|
|
8
|
+
|
|
9
|
+
SOURCE_URL = "https://github.com/xinshoutw/xincord" # the default source link: this repository
|
|
10
|
+
# Discord's limit for a link button's URL, the strictest place a template can put the link.
|
|
11
|
+
URL_MAX = 512
|
|
12
|
+
|
|
13
|
+
# Checked when the plugin loads, so that a typo disables it with an error that names the key
|
|
14
|
+
# instead of showing a broken link or making Discord refuse the reply.
|
|
15
|
+
SourceUrl = Annotated[str, StringConstraints(pattern=r"^https?://\S+$", max_length=URL_MAX)]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Config(Model):
|
|
19
|
+
"""``plugins/BotInfo/config.yaml``; the bundled ``config.yaml`` holds the same defaults.
|
|
20
|
+
|
|
21
|
+
The core config's ``plugins`` list enables the plugin; an ``enabled`` key here only warns.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
# The link to the bot's source code that /bot-info shows (decision C3, AGPL section 13).
|
|
25
|
+
source_url: SourceUrl = SOURCE_URL
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# BotInfo: list it under `plugins` in the core config.yaml to enable it. The bot then needs the
|
|
2
|
+
# Server Members intent, allowed for it in the Discord developer portal, to keep the member count
|
|
3
|
+
# of /bot-info up to date.
|
|
4
|
+
|
|
5
|
+
# The link to the bot's source code that /bot-info shows (an http or https URL). The AGPL (section
|
|
6
|
+
# 13) asks whoever runs a modified bot to offer its users the source of that version: point this
|
|
7
|
+
# at it.
|
|
8
|
+
source_url: "https://github.com/xinshoutw/xincord"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
embeds:
|
|
2
|
+
- author:
|
|
3
|
+
name: "Info Query"
|
|
4
|
+
icon_url: "https://i.imgur.com/a7z4ch2.png"
|
|
5
|
+
title:
|
|
6
|
+
text: "☛ ORDERLY BOT's INFORMATION"
|
|
7
|
+
footer:
|
|
8
|
+
text: "❖ ORDERLY SERVER ❖"
|
|
9
|
+
|
|
10
|
+
fields:
|
|
11
|
+
- name: "Server Counts"
|
|
12
|
+
value: "%guild_counts%"
|
|
13
|
+
|
|
14
|
+
- name: "Member Counts"
|
|
15
|
+
value: "%member_counts%"
|
|
16
|
+
|
|
17
|
+
- name: "Source Code"
|
|
18
|
+
value: "%source_url%"
|
|
19
|
+
|
|
20
|
+
color_code: "#00FFFF"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
embeds:
|
|
2
|
+
- author:
|
|
3
|
+
name: "狀態查詢"
|
|
4
|
+
icon_url: "https://i.imgur.com/a7z4ch2.png"
|
|
5
|
+
title:
|
|
6
|
+
text: "☛ 序之徒的資訊"
|
|
7
|
+
footer:
|
|
8
|
+
text: "❖ ORDERLY SERVER ❖"
|
|
9
|
+
|
|
10
|
+
fields:
|
|
11
|
+
- name: "伺服器總數"
|
|
12
|
+
value: "%guild_counts%"
|
|
13
|
+
|
|
14
|
+
- name: "成員總數"
|
|
15
|
+
value: "%member_counts%"
|
|
16
|
+
|
|
17
|
+
- name: "原始碼"
|
|
18
|
+
value: "%source_url%"
|
|
19
|
+
|
|
20
|
+
color_code: "#00FFFF"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Calculator: ``/basic-calculate`` evaluates a formula exactly and posts the result."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
import discord
|
|
6
|
+
|
|
7
|
+
from xincord.core.templates import Templates
|
|
8
|
+
|
|
9
|
+
from .cog import Calculator
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from xincord.core.bot import Bot
|
|
13
|
+
|
|
14
|
+
DEPENDS: tuple[str, ...] = ()
|
|
15
|
+
SOFT_DEPENDS: tuple[str, ...] = ()
|
|
16
|
+
INTENTS = discord.Intents.none()
|
|
17
|
+
# Replies use the user's locale and fall back to this one.
|
|
18
|
+
DEFAULT_LOCALE = "zh-TW"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
async def setup(bot: Bot) -> None:
|
|
22
|
+
"""Load the lang files and the templates, then add the cog and its command.
|
|
23
|
+
|
|
24
|
+
The plugin has no config.
|
|
25
|
+
"""
|
|
26
|
+
context = bot.plugin_context(__name__)
|
|
27
|
+
lang = context.lang(DEFAULT_LOCALE)
|
|
28
|
+
cog = Calculator(lang, Templates.load(lang))
|
|
29
|
+
await bot.add_cog(cog)
|
|
30
|
+
# A guild command; discord.py removes it when the plugin unloads.
|
|
31
|
+
bot.tree.add_command(cog.command())
|