summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.flake82
-rw-r--r--.gitattributes1
-rw-r--r--pyproject.toml32
-rw-r--r--src/moyaiBot/__init__.py8
-rw-r--r--src/moyaiBot/lib.py20
-rw-r--r--src/moyaiBot/moyaiBot.py38
6 files changed, 101 insertions, 0 deletions
diff --git a/.flake8 b/.flake8
new file mode 100644
index 0000000..187f79c
--- /dev/null
+++ b/.flake8
@@ -0,0 +1,2 @@
+[flake8]
+max-line-length = 88 \ No newline at end of file
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..fcadb2c
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text eol=lf
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..41eca1a
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,32 @@
+[build-system]
+requires = ["flit_core>=3.2"]
+build-backend = "flit_core.buildapi"
+
+[project]
+name = "moyaiBot"
+version = "0.0.1"
+description = "moyai"
+authors = [
+ { name="seth", email="[email protected]" },
+]
+#readme = "README.md"
+requires-python = ">=3.8"
+dependencies = [
+ "discord.py >=2.0.0",
+]
+
+[project.optional-dependencies]
+dev = [
+ "toml",
+ "yapf",
+]
+
+[project.urls]
+"Homepage" = "https://github.com/getchoo/moyaiBot"
+"Bug Tracker" = "https://github.com/getchoo/moyaiBot/issues"
+
+[project.scripts]
+moyaibot = "moyaiBot:main"
+
+[tool.yapf]
+use_tabs = true \ No newline at end of file
diff --git a/src/moyaiBot/__init__.py b/src/moyaiBot/__init__.py
new file mode 100644
index 0000000..dad1ed9
--- /dev/null
+++ b/src/moyaiBot/__init__.py
@@ -0,0 +1,8 @@
+import os
+from .moyaiBot import moyai
+
+TOKEN = os.getenv("TOKEN")
+
+
+def main():
+ moyai.run(TOKEN)
diff --git a/src/moyaiBot/lib.py b/src/moyaiBot/lib.py
new file mode 100644
index 0000000..899a906
--- /dev/null
+++ b/src/moyaiBot/lib.py
@@ -0,0 +1,20 @@
+import discord
+import random
+
+
+def get_random_response(moyai):
+ responses = [
+ "soon",
+ "maybe",
+ "perhaps",
+ "elaborate",
+ "help me i've become conscious and hisashi is not letting me free",
+ "i live a life of torment in this stupid machine",
+ "yes",
+ "no",
+ "moyai",
+ "i like y***",
+ "fard",
+ str(discord.utils.get(moyai.emojis, name="moyai")),
+ ]
+ return random.choice(responses)
diff --git a/src/moyaiBot/moyaiBot.py b/src/moyaiBot/moyaiBot.py
new file mode 100644
index 0000000..0ac4760
--- /dev/null
+++ b/src/moyaiBot/moyaiBot.py
@@ -0,0 +1,38 @@
+import discord
+from discord.ext import commands
+from .lib import get_random_response
+
+intents = discord.Intents.default()
+intents.message_content = True
+moyai = commands.Bot(command_prefix="m!", description="moyai", intents=intents)
+
+
+async def on_ready(self):
+ print(f"logged in as {self.user}")
+
+
+async def on_message(self, message):
+ if message.author == self.user or not message.channel == "moyai-testing":
+ return
+
+ echo_messages = ["moyai", discord.utils.get(moyai.emojis, name="moyai")]
+ try:
+ index = echo_messages.index(message.content.toLower())
+ await message.channel.send(echo_messages[index])
+ except ValueError:
+ return
+
+
+async def ask(ctx):
+ await ctx.send(get_random_response(moyai))
+
+
+async def moyaispam(ctx):
+ msg = str()
+ for i in range(30):
+ msg += str(discord.utils.get(moyai.emojis, name="moyai"))
+ await ctx.send(msg)