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
const { conversation } = require('@assistant/conversation') | |
const express = require('express') | |
const bodyParser = require('body-parser') | |
const app = conversation() | |
app.handle('test_handle', conv => { | |
conv.add('Hey, finally you did it?') | |
}) |
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
import 'dart:convert'; | |
/// Core School class. Details about individual School. | |
class School { | |
String city; | |
String districty; | |
String name; | |
School({required this.city, required this.name, required this.districty}); | |
factory School.fromJson(Map<String, dynamic> json) { |
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
import 'dart:io'; | |
import 'package:televerse/televerse.dart'; | |
final api = RawAPI(Platform.environment['BOT_TOKEN']!); | |
void main(List<String> args) async { | |
const id = ChannelID("@thexyprob"); | |
final keys = langMsg.keys.toList(); | |
final keyboard = buildKeyboard(); | |
for (final el in keys) { | |
final msgId = int.parse(langMsg[el]!.split("/").last); |
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
import 'dart:math' as math; | |
import 'dart:io'; | |
void main() { | |
stdout.write("❓ Enter p: "); | |
final p = int.parse(stdin.readLineSync()!); | |
stdout.write("❓ Enter q: "); | |
final q = int.parse(stdin.readLineSync()!); | |
final n = p * q; |
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
def binary_search(arr, target): | |
left = 0 | |
right = len(arr) - 1 | |
while left <= right: | |
mid = (left + right) // 2 | |
if arr[mid] == target: | |
return mid | |
elif arr[mid] < target: | |
left = mid + 1 |
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
void main() { | |
final million = 1e6; | |
final billion = 1e9; | |
final mDur = Duration(seconds: million.toInt()); | |
final bDur = Duration(seconds: billion.toInt()); | |
print('1 million seconds is\n${durToString(mDur)}'); | |
print(""); | |
print('1 billion seconds is\n${durToString(bDur)}'); |
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
import 'dart:io'; | |
import 'package:televerse/televerse.dart'; | |
// Bot instance | |
final bot = Bot( | |
Platform.environment["BOT_TOKEN"]!, | |
); | |
// - Variables - // |
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
from pyrogram.client import Client | |
import asyncio | |
import random | |
api_id = 123456 # Your Telegram API ID | |
api_hash = "api-hash" # Telegram API Hash | |
chat_id = -100123456 # Group ID/Username | |
app = Client("my_account", api_id, api_hash, device_model="Random Member Picker", system_version="dev/randommember") |