-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started factoring out code to add a telegram bot
- Loading branch information
Showing
95 changed files
with
164 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Privacy Policy | ||
Last Updated: Jul 28, 2022 | ||
By using our Bot, you agree that you have read and agree to this policy. | ||
|
||
This is our "Privacy Policy" which sets out the policy which governs our use of information you provide in connection with the simple tarot bot. The terms "you" and "your" refer to all individuals or entities accessing this website. The terms "we," "us," "our," refer to the creators of Simple Tarot Bot and "bot" refers to our Discord bot itself. | ||
|
||
We may update this Privacy Policy from time to time. Changes in our Privacy Policy will be effective immediately. If you are a regular user of the bot, we recommend that you check this Privacy Policy on a regular basis. By using the bot, you consent to the collection, use and transfer of your information in accordance with this Privacy Policy. If you do not agree to this Privacy Policy, please do not use our bot. | ||
|
||
PRIVACY STATEMENT | ||
We respect the privacy of your information. We provide this explanation about our information practices as a show of our commitment to protect your privacy. This policy describes the types of information we may collect from you or that you may provide when you visit this website and our practices for collecting, using, maintaining, protecting and disclosing that information. | ||
|
||
Please read this policy carefully to understand our policies and practices regarding your information and how we treat it. If you do not agree with our policies and practices, your choice is not to use our bot. By accessing or using this bot, you agree to this privacy policy. This policy may change from time to time (see Changes to Our Privacy Policy). Your continued use of this bot after we make changes is deemed to be acceptance of those changes, so please check the policy periodically for updates. | ||
|
||
THE INFORMATION WE COLLECT AND HOW WE COLLECT IT | ||
When you use the bot and save settings, we collect and store your discord user id, as well as the preferences you specify. | ||
|
||
THIRD-PARTY WEBSITES | ||
Messages distributed by our bot may contain links to third-party websites. These linked websites are not under our control, and we are not responsible for the privacy practices or the contents of any such linked website or any link contained in any linked website. We provide such links only as a convenience, and the inclusion of a link on the website does not imply endorsement of the linked website by Simple Tarot Bot. If you provide any personal data through any such third-party website, your transaction will occur on the third party’s website (not this website) and the personal data you provide will be collected by and controlled by the privacy policy of that third party. We recommend that you familiarize yourself with the privacy policies and practices of any third parties. PLEASE NOTE THAT THIS PRIVACY POLICY DOES NOT ADDRESS THE PRIVACY OR INFORMATION PRACTICES OF ANY THIRD PARTIES. | ||
|
||
THE WAY WE USE INFORMATION | ||
This Privacy Statement governs use of the information that you provide to us through the bot. It does not govern the manner in which we may use information obtained from other sources (such as public records) or from you by means other than this bot. We and other entities that we are involved in, or provide support for, the operation of this bot or other purposes use information that we collect about you or that you provide to us, including any personal information: | ||
|
||
To provide you with the services of the bot using your specified preferences. | ||
In any other way we may describe when you provide the information. | ||
For any other purpose with your consent. | ||
We may also use your information if provided to us to contact you about our own and third-party services and products that may be of interest to you. If you do not want us to use your information in this way, you can opt out of receiving this information by so indicating in your registration/preferences file or by notifying us. | ||
|
||
CHANGES TO OUR PRIVACY POLICY | ||
It is our policy to post any changes we make to our privacy policy on this page. If we make material changes to how we treat our users’ personal information, we will notify you by e-mail to the primary e-mail address specified in your registration information if any has been established and/or through a notice on the website home page. The date the privacy policy was last revised is identified at the top of the page. If information has been collected, you are responsible for ensuring we have an up-to- date active and deliverable e-mail address for you, and for periodically visiting our website and this privacy policy to check for any changes. | ||
|
||
|
||
CONTACT INFORMATION | ||
To ask questions or comment about this Privacy Policy and our privacy practices, please contact us via Discord. |
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from dotenv import load_dotenv | ||
import discord | ||
import os | ||
|
||
load_dotenv() | ||
bot = discord.Bot() | ||
|
||
@bot.event | ||
async def on_ready(): | ||
print("bot is running") | ||
print(len(bot.guilds)) | ||
|
||
bot.run(os.getenv('DISCORD_TOKEN')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from discordbot import main | ||
|
||
if __name__ == '__main__': | ||
main.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from telegrambot import main | ||
|
||
if __name__ == '__main__': | ||
main.main() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import os | ||
from uuid import uuid4 | ||
from telegram import Update, InlineQueryResultArticle, InlineQueryResultPhoto, InputTextMessageContent | ||
from telegram.ext import ApplicationBuilder, ContextTypes, CommandHandler, filters, MessageHandler, InlineQueryHandler | ||
from dotenv import load_dotenv | ||
|
||
load_dotenv() | ||
|
||
startText = "I'm TarotBot! You can get a tarot reading with /tarot, or update your settings with /settings. Get help with /help" | ||
|
||
# When a user starts interaction with a bot | ||
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE): | ||
await context.bot.send_message( | ||
chat_id=update.effective_chat.id, | ||
text=startText | ||
) | ||
|
||
# For when an unknown command is sent | ||
async def unknown(update: Update, context: ContextTypes.DEFAULT_TYPE): | ||
await context.bot.send_message(chat_id=update.effective_chat.id, text="Sorry, I didn't understand that command.") | ||
|
||
# Help command | ||
async def help_command(update: Update, context: ContextTypes.DEFAULT_TYPE): | ||
await context.bot.send_message( | ||
chat_id=update.effective_chat.id, | ||
text=startText | ||
) | ||
|
||
# TODO: edit settings | ||
async def change_settings(update: Update, context: ContextTypes.DEFAULT_TYPE): | ||
pass | ||
|
||
|
||
# TODO: conduct a reading | ||
# TODO: inline query | ||
async def inline_query(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: | ||
"""Handle the inline query. This is run when you type: @botusername <query>""" | ||
# query = update.inline_query.query | ||
|
||
# if query == "": | ||
# return | ||
|
||
results = [ | ||
InlineQueryResultPhoto( | ||
id=str(uuid4()), | ||
photo_url=???, | ||
title=??? | ||
description=???, | ||
caption=??? | ||
) | ||
] | ||
|
||
await update.inline_query.answer( | ||
results, | ||
switch_pm_text="Change Tarot Settings" | ||
) | ||
|
||
|
||
def main(): | ||
application = ApplicationBuilder().token(os.getenv('TELEGRAM_API_TOKEN')).build() | ||
|
||
application.add_handler(CommandHandler('start', start)) | ||
application.add_handler(CommandHandler('settings', change_settings)) | ||
application.add_handler(CommandHandler('help', help_command)) | ||
application.add_handler(InlineQueryHandler(inline_query)) | ||
|
||
# Should be the last handler | ||
application.add_handler(MessageHandler(filters.COMMAND, unknown)) | ||
|
||
|
||
application.run_polling() | ||
|
||
if __name__ == '__main__': | ||
main() |