commit
19de2e2e2d
@ -19,6 +19,7 @@ Cog Function
|
|||||||
| secrethitler | **Incomplete** | <details><summary>Play the Secret Hitler game</summary>Concept, no work done yet</details> |
|
| secrethitler | **Incomplete** | <details><summary>Play the Secret Hitler game</summary>Concept, no work done yet</details> |
|
||||||
| stealemoji | **Alpha** | <details><summary>Steals any custom emoji it sees in a reaction</summary>Some planned upgrades for server generation</details> |
|
| stealemoji | **Alpha** | <details><summary>Steals any custom emoji it sees in a reaction</summary>Some planned upgrades for server generation</details> |
|
||||||
| timerole | **Alpha** | <details><summary>Add roles to members after specified time on the server</summary>Upgraded from V2, please report any bugs</details> |
|
| timerole | **Alpha** | <details><summary>Add roles to members after specified time on the server</summary>Upgraded from V2, please report any bugs</details> |
|
||||||
|
| tts | **Alpha** | <details><summary>Send a Text-to-Speech message as an uploaded mp3</summary>Initial release, please report any bugs</details> |
|
||||||
| werewolf | **Alpha** | <details><summary>Play the classic party game Werewolf within discord</summary>Another massive project currently being developed, will be fully customizable</details> |
|
| werewolf | **Alpha** | <details><summary>Play the classic party game Werewolf within discord</summary>Another massive project currently being developed, will be fully customizable</details> |
|
||||||
|
|
||||||
|
|
||||||
|
5
tts/__init__.py
Normal file
5
tts/__init__.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from .tts import TTS
|
||||||
|
|
||||||
|
|
||||||
|
def setup(bot):
|
||||||
|
bot.add_cog(TTS(bot))
|
22
tts/info..json
Normal file
22
tts/info..json
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"author": [
|
||||||
|
"Bobloy"
|
||||||
|
],
|
||||||
|
"bot_version": [
|
||||||
|
3,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"description": "Send Text2Speech messages as an uploaded mp3",
|
||||||
|
"hidden": true,
|
||||||
|
"install_msg": "Thank you for installing TTS. Get started with `[p]tts`",
|
||||||
|
"requirements": [
|
||||||
|
"gTTS"
|
||||||
|
],
|
||||||
|
"short": "Send TTS messages as uploaded mp3",
|
||||||
|
"tags": [
|
||||||
|
"bobloy",
|
||||||
|
"utils",
|
||||||
|
"audio"
|
||||||
|
]
|
||||||
|
}
|
34
tts/tts.py
Normal file
34
tts/tts.py
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import io
|
||||||
|
|
||||||
|
import discord
|
||||||
|
from gtts import gTTS
|
||||||
|
from redbot.core import Config, commands
|
||||||
|
from redbot.core.bot import Red
|
||||||
|
|
||||||
|
|
||||||
|
class TTS:
|
||||||
|
"""
|
||||||
|
V3 Cog Template
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, bot: Red):
|
||||||
|
self.bot = bot
|
||||||
|
|
||||||
|
self.config = Config.get_conf(self, identifier=9811198108111121, force_registration=True)
|
||||||
|
default_global = {}
|
||||||
|
default_guild = {}
|
||||||
|
|
||||||
|
self.config.register_global(**default_global)
|
||||||
|
self.config.register_guild(**default_guild)
|
||||||
|
|
||||||
|
@commands.command(aliases=["t2s", "text2"])
|
||||||
|
async def tts(self, ctx: commands.Context, *, text: str):
|
||||||
|
"""
|
||||||
|
My custom cog
|
||||||
|
|
||||||
|
Extra information goes here
|
||||||
|
"""
|
||||||
|
mp3_fp = io.BytesIO()
|
||||||
|
tts = gTTS(text, 'en')
|
||||||
|
tts.write_to_fp(mp3_fp)
|
||||||
|
await ctx.send(file=discord.File(mp3_fp.getvalue(), "text.mp3"))
|
Loading…
x
Reference in New Issue
Block a user