Skip to content

Commit

Permalink
Merge pull request #7 from SpectrixDev/beta
Browse files Browse the repository at this point in the history
Added maxMsgLength and updated Readme + data types
  • Loading branch information
SpectrixDev committed Aug 10, 2023
2 parents a826947 + 7aa78e5 commit f0e3471
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
[![python 3.6](https://img.shields.io/badge/python-3.6-red.svg)](https://www.python.org/)
<br>

> 🤖📞 A discord bot that can call your actual phone through Discord using IFTTT and Python. Easy to set up and customize. Uses IFTT's VOIP applet (not your actual phone number).
> 🤖📞 A Discord Bot that calls your phone through a Discord command using IFTTT and Python. Simple to configure and tailor to your needs. Utilizes IFTTT's VOIP applet, which doesn't involve your personal phone number.
*Basically unmaintaned, but it still works! (Last checked 19/11/2021)*
## ℹ Disclaimers:
1. This is not a serious project, so you may encounter bugs. If you find any, or if you require help, please open up an issue on this repo.

## ℹ Disclaimer:
*Many people are confused about what this does, so please read the following before continuing*

⚠ No, this does **not phone your phone through an actual phone number**. It uses **[IFTTT'S VOIP (click here to read more)](https://ifttt.com/voip_calls) applet**, which basically means it uses the [IFTTT](https://ifttt.com/about) app.
2. This does **not phone your phone through an actual phone number**. It uses **[IFTTT'S VOIP (click here to read more)](https://ifttt.com/voip_calls) applet**, which basically means it uses the [IFTTT](https://ifttt.com/about) app.

## 💡 Setup

Expand Down Expand Up @@ -42,20 +40,20 @@ Next, go to https://ifttt.com/services/maker_webhooks/settings and grab the toke
Now go to the **config.json** file and fill in the required information. Here's what each piece means (found in config.json.example):

```json

"prefix": Used to "talk to" your bot. You can also mention the bot by default to run commands, but you also need a prefix.
"callCoolDown": Set a cooldown between how long users can use the call command. I recommend 30 seconds or more (this is per user)
"eventName": The event name from your webhook
"IFTTTkey": The IFTTT token/key that you got from the webhook settings URL thingy
"discordToken": Your bot token from the Discord developer portal in the bot section (NOT client secret/client ID)
"prefix": String: Used to "talk to" your bot. You can also mention the bot by default to run commands, but you also need a prefix.
"callCoolDown": Integer: Set a cooldown between how long users can use the call command. I recommend 30 seconds or more (this is per user)
"maxMsgLength": Integer: The max amount of characters for the message to be read aloud over the phone call. Should be less than 2000, I recommend 250
"eventName": String: The event name from your webhook
"IFTTTkey": String: The IFTTT token/key that you got from the webhook settings URL thingy
"discordToken": String: Your bot token from the Discord developer portal in the bot section (NOT client secret/client ID)
```

**🎉 After filling in the information and saving, running the bot should work!**

## 🤝 Contributing and other notes
## 🤝 Contributing

⭐Please star the repo, or even join my [Discord server](https://discord.gg/Fb8wZsn)

If you have any problems open an issue or join the server and I'll gladly help!
If you have any problems open an issue, I'll gladly help.

If you'd like to contribute, go ahead!
8 changes: 5 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"prefix": ">",
"callCoolDown": "",
"prefix": "",
"callCoolDown": 30,
"maxMsgLength": 250,
"eventName": "",
"IFTTTkey": "",
"discordToken": ""
}
}

11 changes: 6 additions & 5 deletions config.json.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"prefix": '>'
"callCoolDown": "30"
"eventName": "fsdfsdg-fdsafasdf"
"IFTTTkey": "Tgasd4gagigj94egji"
"discordToken": "MzISDUOFIAJ8EJkfojF8JIDFJOIAUDFIDSFOAIDFJjsdfikosdjUIHJi"
"prefix": String: Used to "talk to" your bot. You can also mention the bot by default to run commands, but you also need a prefix.
"callCoolDown": Integer: Set a cooldown between how long users can use the call command. I recommend 30 seconds or more (this is per user)
"maxMsgLength": Integer: The max amount of characters for the message to be read aloud over the phone call. Should be less than 2000, I recommend 250
"eventName": String: The event name from your webhook
"IFTTTkey": String: The IFTTT token/key that you got from the webhook settings URL thingy
"discordToken": String: Your bot token from the Discord developer portal in the bot section (NOT client secret/client ID)
}
8 changes: 4 additions & 4 deletions phoneBot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
For setup instructions, read the README.md
By Spectrix. Enjoy
By SpectrixDev. Enjoy.
https://spectrixdev.github.io/
"""

Expand All @@ -15,20 +15,20 @@

@bot.event
async def on_ready():
print("=========\nReady for use!\n=========\nBot created by Spectrix#7745! hf <3")
print("=========\nReady for use!\n=========\nBot created by https://github.com/SpectrixDev")

@commands.cooldown(1, int(config["callCoolDown"]), BucketType.user)
@bot.command()
async def call(ctx, *, message):
if len(message) <= 250:
if len(message) <= int(config["maxMsgLength"]):
report = {}
report["value1"] = f"New message. {message}"
report["value2"] = f". Sent by {ctx.author.name} on the server {ctx.guild.name}."
async with aiohttp.ClientSession() as session:
await session.post(f"https://maker.ifttt.com/trigger/{config['eventName']}/with/key/{config['IFTTTkey']}", data=report)
await ctx.send("**Data posted! Calling the bot owner now :telephone_receiver:**")
else:
await ctx.send(f"**{ctx.author.mention} You can't send messages over 250 chars long. :no_entry:**")
await ctx.send(f"**{ctx.author.mention} You can't send messages over {config['maxMsgLength']} chars long. :no_entry:**")

@bot.event
async def on_command_error(ctx, error):
Expand Down

0 comments on commit f0e3471

Please sign in to comment.